From: syzbot <syzbot+ec369e6d58e210135f71@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] WARNING in ethnl_req_get_phydev
Date: Mon, 26 Aug 2024 05:26:37 -0700 [thread overview]
Message-ID: <0000000000007a6a700620953c66@google.com> (raw)
In-Reply-To: <0000000000004168390620923787@google.com>
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: WARNING in ethnl_req_get_phydev
Author: djahchankoike@gmail.com
#syz test
ethnl_req_get_phydev should be called with the rtnl lock
held.
Signed-off-by: Diogo Jahchan Koike <djahchankoike@gmail.com>
---
net/ethtool/pse-pd.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/net/ethtool/pse-pd.c b/net/ethtool/pse-pd.c
index 507cb21d6bf0..290edbfd47d2 100644
--- a/net/ethtool/pse-pd.c
+++ b/net/ethtool/pse-pd.c
@@ -226,17 +226,21 @@ ethnl_set_pse_validate(struct ethnl_req_info *req_info, struct genl_info *info)
{
struct nlattr **tb = info->attrs;
struct phy_device *phydev;
+ int ret = 1;
+ rtnl_lock();
phydev = ethnl_req_get_phydev(req_info, tb[ETHTOOL_A_PSE_HEADER],
info->extack);
if (IS_ERR_OR_NULL(phydev)) {
NL_SET_ERR_MSG(info->extack, "No PHY is attached");
- return -EOPNOTSUPP;
+ ret = -EOPNOTSUPP;
+ goto out;
}
if (!phydev->psec) {
NL_SET_ERR_MSG(info->extack, "No PSE is attached");
- return -EOPNOTSUPP;
+ ret = -EOPNOTSUPP;
+ goto out;
}
if (tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL] &&
@@ -244,17 +248,21 @@ ethnl_set_pse_validate(struct ethnl_req_info *req_info, struct genl_info *info)
NL_SET_ERR_MSG_ATTR(info->extack,
tb[ETHTOOL_A_PODL_PSE_ADMIN_CONTROL],
"setting PoDL PSE admin control not supported");
- return -EOPNOTSUPP;
+ ret = -EOPNOTSUPP;
+ goto out;
}
if (tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL] &&
!pse_has_c33(phydev->psec)) {
NL_SET_ERR_MSG_ATTR(info->extack,
tb[ETHTOOL_A_C33_PSE_ADMIN_CONTROL],
"setting C33 PSE admin control not supported");
- return -EOPNOTSUPP;
+ ret = -EOPNOTSUPP;
+ goto out;
}
- return 1;
+out:
+ rtnl_unlock();
+ return ret;
}
static int
--
2.43.0
prev parent reply other threads:[~2024-08-26 12:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-26 8:50 [syzbot] [net?] WARNING in ethnl_req_get_phydev syzbot
2024-08-26 11:57 ` Maxime Chevallier
2024-08-26 12:26 ` syzbot [this message]
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=0000000000007a6a700620953c66@google.com \
--to=syzbot+ec369e6d58e210135f71@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox