* [PATCH] net: fix unreleased lock in ethnl_act_cable_test
@ 2024-08-26 12:14 Diogo Jahchan Koike
2024-08-26 13:05 ` Andrew Lunn
2024-08-26 13:45 ` [patch net-next v2] net: fix unreleased lock in cable test Diogo Jahchan Koike
0 siblings, 2 replies; 5+ messages in thread
From: Diogo Jahchan Koike @ 2024-08-26 12:14 UTC (permalink / raw)
To: davem
Cc: edumazet, kuba, pabeni, maxime.chevallier, andrew,
christophe.leroy, linux, linux-kernel, linux-kernel-mentees,
syzkaller-bugs, Diogo Jahchan Koike, syzbot+c641161e97237326ea74
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@syzkaller.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@gmail.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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: fix unreleased lock in ethnl_act_cable_test
2024-08-26 12:14 [PATCH] net: fix unreleased lock in ethnl_act_cable_test Diogo Jahchan Koike
@ 2024-08-26 13:05 ` Andrew Lunn
2024-08-26 13:45 ` [patch net-next v2] net: fix unreleased lock in cable test Diogo Jahchan Koike
1 sibling, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2024-08-26 13:05 UTC (permalink / raw)
To: Diogo Jahchan Koike
Cc: davem, edumazet, kuba, pabeni, maxime.chevallier,
christophe.leroy, linux, linux-kernel, linux-kernel-mentees,
syzkaller-bugs, syzbot+c641161e97237326ea74
On Mon, Aug 26, 2024 at 09:14:15AM -0300, Diogo Jahchan Koike wrote:
> fix an unreleased lock in out_dev_put path and substitute
> both labels (out_rtnl and out_dev_put) for a simpler out.
Hi Diogo
We try to keep fixes simple. I would of changed the out_dev_put to
out_rtnl, and then removed the unused out_dev_put. That makes the
change smaller, more obviously correct.
As far as i can see, 3688ff3077d3 is only in net-next, not an -rc
kernel. As such, we want this patch added to net-next. You indicate
this in the patch Subject: [path net-next v2].
Thanks
Andrew
---
pw-bot: cr
^ permalink raw reply [flat|nested] 5+ messages in thread
* [patch net-next v2] net: fix unreleased lock in cable test
2024-08-26 12:14 [PATCH] net: fix unreleased lock in ethnl_act_cable_test Diogo Jahchan Koike
2024-08-26 13:05 ` Andrew Lunn
@ 2024-08-26 13:45 ` Diogo Jahchan Koike
2024-08-26 16:16 ` Maxime Chevallier
2024-08-27 20:10 ` patchwork-bot+netdevbpf
1 sibling, 2 replies; 5+ messages in thread
From: Diogo Jahchan Koike @ 2024-08-26 13:45 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Christophe Leroy, Maxime Chevallier
Cc: Diogo Jahchan Koike, syzbot+c641161e97237326ea74, netdev, linux-kernel
fix an unreleased lock in out_dev_put path by removing the (now)
unnecessary path.
Reported-by: syzbot+c641161e97237326ea74@syzkaller.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@gmail.com>
---
net/ethtool/cabletest.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/ethtool/cabletest.c b/net/ethtool/cabletest.c
index 01db8f394869..8c5aa63cb1aa 100644
--- a/net/ethtool/cabletest.c
+++ b/net/ethtool/cabletest.c
@@ -77,7 +77,7 @@ 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_rtnl;
}
ops = ethtool_phy_ops;
@@ -99,7 +99,6 @@ int ethnl_act_cable_test(struct sk_buff *skb, struct genl_info *info)
out_rtnl:
rtnl_unlock();
-out_dev_put:
ethnl_parse_header_dev_put(&req_info);
return ret;
}
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch net-next v2] net: fix unreleased lock in cable test
2024-08-26 13:45 ` [patch net-next v2] net: fix unreleased lock in cable test Diogo Jahchan Koike
@ 2024-08-26 16:16 ` Maxime Chevallier
2024-08-27 20:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 5+ messages in thread
From: Maxime Chevallier @ 2024-08-26 16:16 UTC (permalink / raw)
To: Diogo Jahchan Koike
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Christophe Leroy, syzbot+c641161e97237326ea74, netdev,
linux-kernel
Hi,
Thanks for addressing this, I was unavailable in the past hours to
quicky respond to the issue so your help is welcome :)
On Mon, 26 Aug 2024 10:45:46 -0300
Diogo Jahchan Koike <djahchankoike@gmail.com> wrote:
> fix an unreleased lock in out_dev_put path by removing the (now)
> unnecessary path.
>
> Reported-by: syzbot+c641161e97237326ea74@syzkaller.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@gmail.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Thanks,
Maxime
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch net-next v2] net: fix unreleased lock in cable test
2024-08-26 13:45 ` [patch net-next v2] net: fix unreleased lock in cable test Diogo Jahchan Koike
2024-08-26 16:16 ` Maxime Chevallier
@ 2024-08-27 20:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-08-27 20:10 UTC (permalink / raw)
To: Diogo Jahchan Koike
Cc: davem, edumazet, kuba, pabeni, christophe.leroy,
maxime.chevallier, syzbot+c641161e97237326ea74, netdev,
linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 26 Aug 2024 10:45:46 -0300 you wrote:
> fix an unreleased lock in out_dev_put path by removing the (now)
> unnecessary path.
>
> Reported-by: syzbot+c641161e97237326ea74@syzkaller.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@gmail.com>
>
> [...]
Here is the summary with links:
- [net-next,v2] net: fix unreleased lock in cable test
https://git.kernel.org/netdev/net-next/c/3d6a0c4f4552
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-08-27 20:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-26 12:14 [PATCH] net: fix unreleased lock in ethnl_act_cable_test Diogo Jahchan Koike
2024-08-26 13:05 ` Andrew Lunn
2024-08-26 13:45 ` [patch net-next v2] net: fix unreleased lock in cable test Diogo Jahchan Koike
2024-08-26 16:16 ` Maxime Chevallier
2024-08-27 20:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®