[v6.1] possible deadlock in team_del_slave

0 views
Skip to first unread message

syzbot

unread,
Mar 27, 2024, 6:53:18 AMMar 27
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: e5cd595e23c1 Linux 6.1.83
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13b9d335180000
kernel config: https://syzkaller.appspot.com/x/.config?x=99d0cbbc2b2c7cfd
dashboard link: https://syzkaller.appspot.com/bug?extid=ab28804e314206ed9d4f
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/cd28292a2eef/disk-e5cd595e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e8297fd856b2/vmlinux-e5cd595e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/ea8c74634429/bzImage-e5cd595e.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+ab2880...@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
6.1.83-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.2/17351 is trying to acquire lock:
ffff88807a3ccd00 (team->team_lock_key#10){+.+.}-{3:3}, at: team_del_slave+0x2e/0x1c0 drivers/net/team/team.c:2001

but task is already holding lock:
ffff88805e8587c8 (&rdev->wiphy.mtx){+.+.}-{3:3}, at: nl80211_del_interface+0x112/0x130 net/wireless/nl80211.c:4332

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&rdev->wiphy.mtx){+.+.}-{3:3}:
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747
wiphy_lock include/net/cfg80211.h:5639 [inline]
ieee80211_open+0x13a/0x1f0 net/mac80211/iface.c:437
__dev_open+0x377/0x510 net/core/dev.c:1457
dev_open+0xa9/0x260 net/core/dev.c:1493
team_port_add drivers/net/team/team.c:1217 [inline]
team_add_slave+0x96e/0x2760 drivers/net/team/team.c:1987
do_set_master net/core/rtnetlink.c:2598 [inline]
do_setlink+0xe99/0x3e30 net/core/rtnetlink.c:2808
rtnl_setlink+0x3f1/0x560 net/core/rtnetlink.c:3092
rtnetlink_rcv_msg+0x818/0xff0 net/core/rtnetlink.c:6121
netlink_rcv_skb+0x1cd/0x410 net/netlink/af_netlink.c:2508
netlink_unicast_kernel net/netlink/af_netlink.c:1326 [inline]
netlink_unicast+0x7d8/0x970 net/netlink/af_netlink.c:1352
netlink_sendmsg+0xa26/0xd60 net/netlink/af_netlink.c:1874
sock_sendmsg_nosec net/socket.c:718 [inline]
__sock_sendmsg net/socket.c:730 [inline]
____sys_sendmsg+0x5a5/0x8f0 net/socket.c:2514
___sys_sendmsg net/socket.c:2568 [inline]
__sys_sendmsg+0x2a9/0x390 net/socket.c:2597
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (team->team_lock_key#10){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3090 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825
__lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747
team_del_slave+0x2e/0x1c0 drivers/net/team/team.c:2001
team_device_event+0x269/0x570 drivers/net/team/team.c:3044
notifier_call_chain kernel/notifier.c:87 [inline]
raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:455
call_netdevice_notifiers_info net/core/dev.c:1970 [inline]
call_netdevice_notifiers_extack net/core/dev.c:2008 [inline]
call_netdevice_notifiers net/core/dev.c:2022 [inline]
unregister_netdevice_many+0xec1/0x17a0 net/core/dev.c:10881
unregister_netdevice_queue+0x2e6/0x350 net/core/dev.c:10812
unregister_netdevice include/linux/netdevice.h:3045 [inline]
_cfg80211_unregister_wdev+0x174/0x570 net/wireless/core.c:1205
ieee80211_if_remove+0x1cc/0x2d0 net/mac80211/iface.c:2291
ieee80211_del_iface+0x15/0x20 net/mac80211/cfg.c:202
rdev_del_virtual_intf net/wireless/rdev-ops.h:62 [inline]
cfg80211_remove_virtual_intf+0x270/0x490 net/wireless/util.c:2502
genl_family_rcv_msg_doit net/netlink/genetlink.c:756 [inline]
genl_family_rcv_msg net/netlink/genetlink.c:833 [inline]
genl_rcv_msg+0xc1a/0xf70 net/netlink/genetlink.c:850
netlink_rcv_skb+0x1cd/0x410 net/netlink/af_netlink.c:2508
genl_rcv+0x24/0x40 net/netlink/genetlink.c:861
netlink_unicast_kernel net/netlink/af_netlink.c:1326 [inline]
netlink_unicast+0x7d8/0x970 net/netlink/af_netlink.c:1352
netlink_sendmsg+0xa26/0xd60 net/netlink/af_netlink.c:1874
sock_sendmsg_nosec net/socket.c:718 [inline]
__sock_sendmsg net/socket.c:730 [inline]
____sys_sendmsg+0x5a5/0x8f0 net/socket.c:2514
___sys_sendmsg net/socket.c:2568 [inline]
__sys_sendmsg+0x2a9/0x390 net/socket.c:2597
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd

other info that might help us debug this:

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&rdev->wiphy.mtx);
lock(team->team_lock_key#10);
lock(&rdev->wiphy.mtx);
lock(team->team_lock_key#10);

*** DEADLOCK ***

3 locks held by syz-executor.2/17351:
#0: ffffffff8e2f8030 (cb_lock){++++}-{3:3}, at: genl_rcv+0x15/0x40 net/netlink/genetlink.c:860
#1: ffffffff8e2991e8 (rtnl_mutex){+.+.}-{3:3}, at: nl80211_pre_doit+0x5b/0x8a0 net/wireless/nl80211.c:16189
#2: ffff88805e8587c8 (&rdev->wiphy.mtx){+.+.}-{3:3}, at: nl80211_del_interface+0x112/0x130 net/wireless/nl80211.c:4332

stack backtrace:
CPU: 1 PID: 17351 Comm: syz-executor.2 Not tainted 6.1.83-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2170
check_prev_add kernel/locking/lockdep.c:3090 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825
__lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747
team_del_slave+0x2e/0x1c0 drivers/net/team/team.c:2001
team_device_event+0x269/0x570 drivers/net/team/team.c:3044
notifier_call_chain kernel/notifier.c:87 [inline]
raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:455
call_netdevice_notifiers_info net/core/dev.c:1970 [inline]
call_netdevice_notifiers_extack net/core/dev.c:2008 [inline]
call_netdevice_notifiers net/core/dev.c:2022 [inline]
unregister_netdevice_many+0xec1/0x17a0 net/core/dev.c:10881
unregister_netdevice_queue+0x2e6/0x350 net/core/dev.c:10812
unregister_netdevice include/linux/netdevice.h:3045 [inline]
_cfg80211_unregister_wdev+0x174/0x570 net/wireless/core.c:1205
ieee80211_if_remove+0x1cc/0x2d0 net/mac80211/iface.c:2291
ieee80211_del_iface+0x15/0x20 net/mac80211/cfg.c:202
rdev_del_virtual_intf net/wireless/rdev-ops.h:62 [inline]
cfg80211_remove_virtual_intf+0x270/0x490 net/wireless/util.c:2502
genl_family_rcv_msg_doit net/netlink/genetlink.c:756 [inline]
genl_family_rcv_msg net/netlink/genetlink.c:833 [inline]
genl_rcv_msg+0xc1a/0xf70 net/netlink/genetlink.c:850
netlink_rcv_skb+0x1cd/0x410 net/netlink/af_netlink.c:2508
genl_rcv+0x24/0x40 net/netlink/genetlink.c:861
netlink_unicast_kernel net/netlink/af_netlink.c:1326 [inline]
netlink_unicast+0x7d8/0x970 net/netlink/af_netlink.c:1352
netlink_sendmsg+0xa26/0xd60 net/netlink/af_netlink.c:1874
sock_sendmsg_nosec net/socket.c:718 [inline]
__sock_sendmsg net/socket.c:730 [inline]
____sys_sendmsg+0x5a5/0x8f0 net/socket.c:2514
___sys_sendmsg net/socket.c:2568 [inline]
__sys_sendmsg+0x2a9/0x390 net/socket.c:2597
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f6412e7dda9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f6413b960c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f6412fabf80 RCX: 00007f6412e7dda9
RDX: 0000000000000000 RSI: 0000000020000400 RDI: 0000000000000003
RBP: 00007f6412eca47a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f6412fabf80 R15: 00007ffdc714fd38
</TASK>
team0: Port device wlan0 removed


---
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 syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

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

syzbot

unread,
Mar 27, 2024, 10:17:24 AMMar 27
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: e5cd595e23c1 Linux 6.1.83
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1433e6be180000
kernel config: https://syzkaller.appspot.com/x/.config?x=99d0cbbc2b2c7cfd
dashboard link: https://syzkaller.appspot.com/bug?extid=ab28804e314206ed9d4f
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=115d3a95180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17ebb791180000
netlink: 'syz-executor186': attribute type 10 has an invalid length.
netlink: 40 bytes leftover after parsing attributes in process `syz-executor186'.
team0: Port device wlan0 added
======================================================
WARNING: possible circular locking dependency detected
6.1.83-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor186/3555 is trying to acquire lock:
ffff8880737ccd00 (team->team_lock_key){+.+.}-{3:3}, at: team_del_slave+0x2e/0x1c0 drivers/net/team/team.c:2001

but task is already holding lock:
ffff88807d4c07c8 (&rdev->wiphy.mtx){+.+.}-{3:3}, at: nl80211_del_interface+0x112/0x130 net/wireless/nl80211.c:4332
-> #0 (team->team_lock_key){+.+.}-{3:3}:
lock(team->team_lock_key);
lock(&rdev->wiphy.mtx);
lock(team->team_lock_key);

*** DEADLOCK ***

3 locks held by syz-executor186/3555:
#0: ffffffff8e2f8030 (cb_lock){++++}-{3:3}, at: genl_rcv+0x15/0x40 net/netlink/genetlink.c:860
#1: ffffffff8e2991e8 (rtnl_mutex){+.+.}-{3:3}, at: nl80211_pre_doit+0x5b/0x8a0 net/wireless/nl80211.c:16189
#2: ffff88807d4c07c8 (&rdev->wiphy.mtx){+.+.}-{3:3}, at: nl80211_del_interface+0x112/0x130 net/wireless/nl80211.c:4332

stack backtrace:
CPU: 1 PID: 3555 Comm: syz-executor186 Not tainted 6.1.83-syzkaller #0
RIP: 0033:0x7f556bb99899
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 d1 19 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:00007fffe454d618 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f556bb99899
RDX: 0000000000000000 RSI: 0000000020000400 RDI: 0000000000000004
RBP: 00000000000f4240 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000031
R13: 00007fffe454d65c R14: 00007fffe454d690 R15: 0000000000000048
</TASK>
team0: Port device wlan0 removed


---
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.
Reply all
Reply to author
Forward
0 new messages