All of lore.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+5cf270e2069645b6bd2c@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] general protection fault in phy_start_cable_test_tdr
Date: Tue, 27 Aug 2024 18:35:31 -0700	[thread overview]
Message-ID: <000000000000a7dc870620b45f8f@google.com> (raw)
In-Reply-To: <00000000000094740b0620b32b4e@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: general protection fault in phy_start_cable_test_tdr
Author: djahchankoike@gmail.com

#syz test

In ethnl_act_cable_test_tdr, phydev is tested for the condition of being
null or an error by checking IS_ERR_OR_NULL, however the result is being
negated and lets a null phydev go through. Simply removing the logical
NOT on the conditional suffices.
---
 net/ethtool/cabletest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ethtool/cabletest.c b/net/ethtool/cabletest.c
index d365ad5f5434..f25da884b3dd 100644
--- a/net/ethtool/cabletest.c
+++ b/net/ethtool/cabletest.c
@@ -346,7 +346,7 @@ int ethnl_act_cable_test_tdr(struct sk_buff *skb, struct genl_info *info)
 	phydev = ethnl_req_get_phydev(&req_info,
 				      tb[ETHTOOL_A_CABLE_TEST_TDR_HEADER],
 				      info->extack);
-	if (!IS_ERR_OR_NULL(phydev)) {
+	if (IS_ERR_OR_NULL(phydev)) {
 		ret = -EOPNOTSUPP;
 		goto out_dev_put;
 	}
-- 
2.43.0


  parent reply	other threads:[~2024-08-28  1:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28  0:09 [syzbot] [net?] general protection fault in phy_start_cable_test_tdr syzbot
2024-08-28  1:34 ` Edward Adam Davis
2024-08-28  2:09   ` syzbot
2024-08-28  1:35 ` syzbot [this message]
2024-08-28  6:23 ` Maxime Chevallier
2024-10-04  2:26 ` syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=000000000000a7dc870620b45f8f@google.com \
    --to=syzbot+5cf270e2069645b6bd2c@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.