WARNING in ethnl_req_get_phydev
Subsystems (4)
syzbot
syzbotHello,
syzbot found the following issue on:
HEAD commit: f9db28bb09f4 Merge branch 'net-redundant-judgments' git tree: net-next console+strace: https://syzkaller.appspot.com/x/log.txt?x=1051fa7b980000 kernel config: https://syzkaller.appspot.com/x/.config?x=df2f0ed7e30a639d dashboard link: https://syzkaller.appspot.com/bug?extid=ec369e6d58e210135f71 compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=113da825980000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10d5f229980000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/585e02f7fe7b/disk-f9db28bb.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b9faf5d24900/vmlinux-f9db28bb.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f9df5868ea4f/bzImage-f9db28bb.xz
The issue was bisected to:
commit 31748765bed3fb7cebf4a32b43a6fdf91b9c23de
Author: Maxime Chevallier <[email protected]> Date: Wed Aug 21 15:10:04 2024 +0000
net: ethtool: pse-pd: Target the command to the requested PHY
bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=13d09047980000 final oops: https://syzkaller.appspot.com/x/report.txt?x=10309047980000 console output: https://syzkaller.appspot.com/x/log.txt?x=17d09047980000
IMPORTANT: if you fix the issue, please add the following tag to the commit:
------------[ cut here ]------------ RTNL: assertion failed at net/ethtool/netlink.c (218) WARNING: CPU: 1 PID: 5237 at net/ethtool/netlink.c:218 ethnl_req_get_phydev+0x1f2/0x220 net/ethtool/netlink.c:218 Modules linked in: CPU: 1 UID: 0 PID: 5237 Comm: syz-executor314 Not tainted 6.11.0-rc4-syzkaller-00565-gf9db28bb09f4 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 RIP: 0010:ethnl_req_get_phydev+0x1f2/0x220 net/ethtool/netlink.c:218 Code: cc cc cc cc e8 bf ac ca f7 c6 05 52 01 39 06 01 90 48 c7 c7 00 9b 11 8d 48 c7 c6 80 99 11 8d ba da 00 00 00 e8 9f d3 8c f7 90 <0f> 0b 90 90 e9 4c fe ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c 7e RSP: 0018:ffffc90003ce7318 EFLAGS: 00010246 RAX: 10ea674e901bf200 RBX: ffffc90003ce73e0 RCX: ffff88802a65bc00 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000 RBP: 0000000000000000 R08: ffffffff8155b4d2 R09: 1ffff1101726519a R10: dffffc0000000000 R11: ffffed101726519b R12: ffffc90003ce75f0 R13: dffffc0000000000 R14: ffff88802cfaf314 R15: ffffc90003ce7740 FS: 0000555586b4c380(0000) GS:ffff8880b9300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020001ac0 CR3: 000000002041e000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> ethnl_set_pse_validate+0x88/0x360 net/ethtool/pse-pd.c:230 ethnl_default_set_doit+0x2b5/0x910 net/ethtool/netlink.c:683 genl_family_rcv_msg_doit net/netlink/genetlink.c:1115 [inline] genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline] genl_rcv_msg+0xb14/0xec0 net/netlink/genetlink.c:1210 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2550 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline] netlink_unicast+0x7f6/0x990 net/netlink/af_netlink.c:1357 netlink_sendmsg+0x8e4/0xcb0 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 ____sys_sendmsg+0x525/0x7d0 net/socket.c:2597 ___sys_sendmsg net/socket.c:2651 [inline] __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2680 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f7423951f49 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 01 1a 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fffce415058 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f7423951f49 RDX: 0000000000000000 RSI: 0000000020001ac0 RDI: 0000000000000003 RBP: 00000000000f4240 R08: 0000000000000000 R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fffce4150b0 R13: 00007f742399f406 R14: 0000000000000003 R15: 00007fffce415090 </TASK>
---
This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at [email protected].
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot. For information about bisection process see: https://goo.gl/tpsmEJ#bisection
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
Hello,
Quoted 21 lines · On Mon, 26 Aug 2024 01:50:24 -0700 syzbot…
Hello,
syzbot found the following issue on:
HEAD commit: f9db28bb09f4 Merge branch 'net-redundant-judgments' git tree: net-next console+strace: https://syzkaller.appspot.com/x/log.txt?x=1051fa7b980000 kernel config: https://syzkaller.appspot.com/x/.config?x=df2f0ed7e30a639d dashboard link: https://syzkaller.appspot.com/bug?extid=ec369e6d58e210135f71 compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=113da825980000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10d5f229980000Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/585e02f7fe7b/disk-f9db28bb.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b9faf5d24900/vmlinux-f9db28bb.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f9df5868ea4f/bzImage-f9db28bb.xzThe issue was bisected to:
commit
31748765bed3fb7cebf4a32b43a6fdf91b9c23de
Quoted 8 lines
Author: Maxime Chevallier <[email protected]> Date: Wed Aug 21 15:10:04 2024 +0000net: ethtool: pse-pd: Target the command to the requested PHY
bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=13d09047980000 final oops: https://syzkaller.appspot.com/x/report.txt?x=10309047980000 console output: https://syzkaller.appspot.com/x/log.txt?x=17d09047980000
Looks also like this is triggered because the validate callback doesn't run under rtnl() as I wrongly assumed. I'll look into it.
Thanks,
Maxime
syzbot
syzbotFor archival purposes, forwarding an incoming command email to [email protected].
For archival purposes, forwarding an incoming command email to [email protected].
***
Subject: WARNING in ethnl_req_get_phydev
Author: [email protected]
#syz test
ethnl_req_get_phydev should be called with the rtnl lock held.
--- net/ethtool/pse-pd.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
net/ethtool/pse-pd.c +13 -5
@@ -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
Signature · 1 line
2.43.0