syzbot


possible deadlock in team_del_slave

Status: upstream: reported C repro on 2024/03/27 10:53
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+ab28804e314206ed9d4f@syzkaller.appspotmail.com
First crash: 80d, last: 3d21h
Bug presence (1)
Date Name Commit Repro Result
2024/04/25 upstream (ToT) e88c4cfcb7b8 C [report] possible deadlock in team_del_slave
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in team_del_slave net 1 1001d 999d 0/27 auto-closed as invalid on 2022/01/16 14:16
upstream possible deadlock in team_del_slave (2) net 35 338d 502d 0/27 auto-obsoleted due to no activity on 2023/09/28 12:50
linux-5.15 possible deadlock in team_del_slave (2) origin:lts-only C 22 18d 154d 0/3 upstream: reported C repro on 2024/01/12 21:46
upstream possible deadlock in team_del_slave (3) net C error 44276 now 50d 0/27 upstream: reported C repro on 2024/04/26 11:59
linux-5.15 possible deadlock in team_del_slave 1 427d 427d 0/3 auto-obsoleted due to no activity on 2023/08/13 07:03
Fix bisection attempts (1)
Created Duration User Patch Repo Result
2024/05/11 14:40 1h45m bisect fix linux-6.1.y job log (0) log

Sample crash report:
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

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){+.+.}-{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);
                               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
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: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

Crashes (25):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/03/27 14:17 linux-6.1.y e5cd595e23c1 454571b6 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/05/13 23:14 linux-6.1.y 909ba1f1b414 9026e142 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in team_del_slave
2024/06/11 20:15 linux-6.1.y 88690811da69 4d75f4f7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/06/10 13:08 linux-6.1.y 88690811da69 82c05ab8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/06/08 23:49 linux-6.1.y 88690811da69 82c05ab8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/06/08 08:37 linux-6.1.y 88690811da69 82c05ab8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/06/08 08:36 linux-6.1.y 88690811da69 82c05ab8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/06/08 04:23 linux-6.1.y 88690811da69 82c05ab8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/06/08 04:22 linux-6.1.y 88690811da69 82c05ab8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/06/08 04:22 linux-6.1.y 88690811da69 82c05ab8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/06/04 03:48 linux-6.1.y 88690811da69 a1feae05 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/06/04 03:48 linux-6.1.y 88690811da69 a1feae05 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/05/27 23:24 linux-6.1.y 88690811da69 761766e6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/05/24 11:36 linux-6.1.y 4078fa637fcd 8f98448e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/05/22 16:50 linux-6.1.y 4078fa637fcd 4d098039 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/05/22 16:50 linux-6.1.y 4078fa637fcd 4d098039 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/05/22 03:52 linux-6.1.y 4078fa637fcd 1014eca7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/05/21 20:39 linux-6.1.y 4078fa637fcd 4c0d3ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/05/13 20:09 linux-6.1.y 909ba1f1b414 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/04/06 08:20 linux-6.1.y 347385861c50 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/03/28 10:20 linux-6.1.y e5cd595e23c1 120789fd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in team_del_slave
2024/03/27 10:52 linux-6.1.y e5cd595e23c1 454571b6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in team_del_slave
2024/05/28 08:33 linux-6.1.y 88690811da69 f550015e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in team_del_slave
2024/05/25 11:03 linux-6.1.y 4078fa637fcd a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in team_del_slave
2024/05/24 09:14 linux-6.1.y 4078fa637fcd 8f98448e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in team_del_slave
* Struck through repros no longer work on HEAD.