diff mbox series

[net-next,v2] net: fix unreleased lock in cable test

Message ID 20240826134656.94892-1-djahchankoike@gmail.com (mailing list archive)
State Accepted
Commit 3d6a0c4f4552c8b08ba63b9da97c8255db4c6a56
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v2] net: fix unreleased lock in cable test | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 1 maintainers not CCed: andrew@lunn.ch
netdev/build_clang success Errors and warnings before: 16 this patch: 16
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 16 this patch: 16
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-27--18-00 (tests: 714)

Commit Message

Diogo Jahchan Koike Aug. 26, 2024, 1:45 p.m. UTC
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(-)

Comments

Maxime Chevallier Aug. 26, 2024, 4:16 p.m. UTC | #1
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
patchwork-bot+netdevbpf@kernel.org Aug. 27, 2024, 8:10 p.m. UTC | #2
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!
diff mbox series

Patch

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;
 }