[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240826121435.88756-1-djahchankoike@gmail.com>
Date: Mon, 26 Aug 2024 09:14:15 -0300
From: Diogo Jahchan Koike <djahchankoike@...il.com>
To: davem@...emloft.net
Cc: edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
maxime.chevallier@...tlin.com,
andrew@...n.ch,
christophe.leroy@...roup.eu,
linux@...blig.org,
linux-kernel@...r.kernel.org,
linux-kernel-mentees@...ts.linuxfoundation.org,
syzkaller-bugs@...glegroups.com,
Diogo Jahchan Koike <djahchankoike@...il.com>,
syzbot+c641161e97237326ea74@...kaller.appspotmail.com
Subject: [PATCH] net: fix unreleased lock in ethnl_act_cable_test
fix an unreleased lock in out_dev_put path and substitute
both labels (out_rtnl and out_dev_put) for a simpler out.
Reported-by: syzbot+c641161e97237326ea74@...kaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=c641161e97237326ea74
Fixes: 3688ff3077d3 ("net: ethtool: cable-test: Target the command to the requested PHY")
Signed-off-by: Diogo Jahchan Koike <djahchankoike@...il.com>
---
net/ethtool/cabletest.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/net/ethtool/cabletest.c b/net/ethtool/cabletest.c
index 01db8f394869..c1f0510eb465 100644
--- a/net/ethtool/cabletest.c
+++ b/net/ethtool/cabletest.c
@@ -77,18 +77,18 @@ int ethnl_act_cable_test(struct sk_buff *skb, struct genl_info *info)
info->extack);
if (IS_ERR_OR_NULL(phydev)) {
ret = -EOPNOTSUPP;
- goto out_dev_put;
+ goto out;
}
ops = ethtool_phy_ops;
if (!ops || !ops->start_cable_test) {
ret = -EOPNOTSUPP;
- goto out_rtnl;
+ goto out;
}
ret = ethnl_ops_begin(dev);
if (ret < 0)
- goto out_rtnl;
+ goto out;
ret = ops->start_cable_test(phydev, info->extack);
@@ -97,9 +97,8 @@ int ethnl_act_cable_test(struct sk_buff *skb, struct genl_info *info)
if (!ret)
ethnl_cable_test_started(phydev, ETHTOOL_MSG_CABLE_TEST_NTF);
-out_rtnl:
+out:
rtnl_unlock();
-out_dev_put:
ethnl_parse_header_dev_put(&req_info);
return ret;
}
--
2.43.0
Powered by blists - more mailing lists