syzbot


possible deadlock in team_del_slave

Status: auto-obsoleted due to no activity on 2023/08/13 07:03
Reported-by: syzbot+08d8ab0dfd5994ad695e@syzkaller.appspotmail.com
First crash: 459d, last: 459d
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in team_del_slave net 1 1033d 1031d 0/27 auto-closed as invalid on 2022/01/16 14:16
upstream possible deadlock in team_del_slave (2) net 35 370d 534d 0/27 auto-obsoleted due to no activity on 2023/09/28 12:50
linux-6.1 possible deadlock in team_del_slave origin:upstream C 29 6d03h 112d 0/3 upstream: reported C repro on 2024/03/27 10:53
linux-5.15 possible deadlock in team_del_slave (2) origin:lts-only C 32 5d21h 187d 0/3 upstream: reported C repro on 2024/01/12 21:46
upstream possible deadlock in team_del_slave (3) net C error 78243 now 82d 0/27 upstream: reported C repro on 2024/04/26 11:59

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
5.15.107-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.1/4480 is trying to acquire lock:
ffff88802bc74cf8 (team->team_lock_key#4){+.+.}-{3:3}, at: team_del_slave+0x2e/0x1f0 drivers/net/team/team.c:1993

but task is already holding lock:
ffff88807b538628 (&rdev->wiphy.mtx){+.+.}-{3:3}, at: nl80211_del_interface+0x127/0x370 net/wireless/nl80211.c:4103

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&rdev->wiphy.mtx){+.+.}-{3:3}:
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
       __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       wiphy_lock include/net/cfg80211.h:5311 [inline]
       ieee80211_open+0x13a/0x1f0 net/mac80211/iface.c:361
       __dev_open+0x36f/0x500 net/core/dev.c:1486
       dev_open+0xa9/0x260 net/core/dev.c:1522
       team_port_add drivers/net/team/team.c:1210 [inline]
       team_add_slave+0x916/0x2760 drivers/net/team/team.c:1979
       do_set_master net/core/rtnetlink.c:2523 [inline]
       do_setlink+0xe71/0x3af0 net/core/rtnetlink.c:2728
       __rtnl_newlink net/core/rtnetlink.c:3395 [inline]
       rtnl_newlink+0x177d/0x2060 net/core/rtnetlink.c:3510
       rtnetlink_rcv_msg+0x993/0xee0 net/core/rtnetlink.c:5587
       netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2533
       netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
       netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1356
       netlink_sendmsg+0xa30/0xd60 net/netlink/af_netlink.c:1952
       sock_sendmsg_nosec net/socket.c:704 [inline]
       sock_sendmsg net/socket.c:724 [inline]
       ____sys_sendmsg+0x59e/0x8f0 net/socket.c:2412
       ___sys_sendmsg+0x252/0x2e0 net/socket.c:2466
       __sys_sendmsg net/socket.c:2495 [inline]
       __do_sys_sendmsg net/socket.c:2504 [inline]
       __se_sys_sendmsg+0x19a/0x260 net/socket.c:2502
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x61/0xcb

-> #0 (team->team_lock_key#4){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3053 [inline]
       check_prevs_add kernel/locking/lockdep.c:3172 [inline]
       validate_chain+0x1646/0x58b0 kernel/locking/lockdep.c:3787
       __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5011
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
       __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       team_del_slave+0x2e/0x1f0 drivers/net/team/team.c:1993
       team_device_event+0x267/0x490 drivers/net/team/team.c:3016
       notifier_call_chain kernel/notifier.c:83 [inline]
       raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391
       call_netdevice_notifiers_info net/core/dev.c:1998 [inline]
       call_netdevice_notifiers_extack net/core/dev.c:2010 [inline]
       call_netdevice_notifiers net/core/dev.c:2024 [inline]
       unregister_netdevice_many+0xf1b/0x18f0 net/core/dev.c:11065
       unregister_netdevice_queue+0x2e6/0x350 net/core/dev.c:10998
       unregister_netdevice include/linux/netdevice.h:3012 [inline]
       _cfg80211_unregister_wdev+0x181/0x510 net/wireless/core.c:1127
       ieee80211_if_remove+0x1cc/0x2c0 net/mac80211/iface.c:2090
       ieee80211_del_iface+0x15/0x20 net/mac80211/cfg.c:145
       rdev_del_virtual_intf net/wireless/rdev-ops.h:57 [inline]
       nl80211_del_interface+0x1f5/0x370 net/wireless/nl80211.c:4105
       genl_family_rcv_msg_doit net/netlink/genetlink.c:731 [inline]
       genl_family_rcv_msg net/netlink/genetlink.c:775 [inline]
       genl_rcv_msg+0xfbd/0x14a0 net/netlink/genetlink.c:792
       netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2533
       genl_rcv+0x24/0x40 net/netlink/genetlink.c:803
       netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
       netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1356
       netlink_sendmsg+0xa30/0xd60 net/netlink/af_netlink.c:1952
       sock_sendmsg_nosec net/socket.c:704 [inline]
       sock_sendmsg net/socket.c:724 [inline]
       ____sys_sendmsg+0x59e/0x8f0 net/socket.c:2412
       ___sys_sendmsg+0x252/0x2e0 net/socket.c:2466
       __sys_sendmsg net/socket.c:2495 [inline]
       __do_sys_sendmsg net/socket.c:2504 [inline]
       __se_sys_sendmsg+0x19a/0x260 net/socket.c:2502
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x61/0xcb

other info that might help us debug this:

 Possible unsafe locking scenario:

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

 *** DEADLOCK ***

3 locks held by syz-executor.1/4480:
 #0: ffffffff8da332b0 (cb_lock){++++}-{3:3}, at: genl_rcv+0x15/0x40 net/netlink/genetlink.c:802
 #1: ffffffff8d9d3ca8 (rtnl_mutex){+.+.}-{3:3}, at: nl80211_pre_doit+0x28/0x540 net/wireless/nl80211.c:14959
 #2: ffff88807b538628 (&rdev->wiphy.mtx){+.+.}-{3:3}, at: nl80211_del_interface+0x127/0x370 net/wireless/nl80211.c:4103

stack backtrace:
CPU: 0 PID: 4480 Comm: syz-executor.1 Not tainted 5.15.107-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 check_noncircular+0x2f8/0x3b0 kernel/locking/lockdep.c:2133
 check_prev_add kernel/locking/lockdep.c:3053 [inline]
 check_prevs_add kernel/locking/lockdep.c:3172 [inline]
 validate_chain+0x1646/0x58b0 kernel/locking/lockdep.c:3787
 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5011
 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
 team_del_slave+0x2e/0x1f0 drivers/net/team/team.c:1993
 team_device_event+0x267/0x490 drivers/net/team/team.c:3016
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391
 call_netdevice_notifiers_info net/core/dev.c:1998 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2010 [inline]
 call_netdevice_notifiers net/core/dev.c:2024 [inline]
 unregister_netdevice_many+0xf1b/0x18f0 net/core/dev.c:11065
 unregister_netdevice_queue+0x2e6/0x350 net/core/dev.c:10998
 unregister_netdevice include/linux/netdevice.h:3012 [inline]
 _cfg80211_unregister_wdev+0x181/0x510 net/wireless/core.c:1127
 ieee80211_if_remove+0x1cc/0x2c0 net/mac80211/iface.c:2090
 ieee80211_del_iface+0x15/0x20 net/mac80211/cfg.c:145
 rdev_del_virtual_intf net/wireless/rdev-ops.h:57 [inline]
 nl80211_del_interface+0x1f5/0x370 net/wireless/nl80211.c:4105
 genl_family_rcv_msg_doit net/netlink/genetlink.c:731 [inline]
 genl_family_rcv_msg net/netlink/genetlink.c:775 [inline]
 genl_rcv_msg+0xfbd/0x14a0 net/netlink/genetlink.c:792
 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2533
 genl_rcv+0x24/0x40 net/netlink/genetlink.c:803
 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
 netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1356
 netlink_sendmsg+0xa30/0xd60 net/netlink/af_netlink.c:1952
 sock_sendmsg_nosec net/socket.c:704 [inline]
 sock_sendmsg net/socket.c:724 [inline]
 ____sys_sendmsg+0x59e/0x8f0 net/socket.c:2412
 ___sys_sendmsg+0x252/0x2e0 net/socket.c:2466
 __sys_sendmsg net/socket.c:2495 [inline]
 __do_sys_sendmsg net/socket.c:2504 [inline]
 __se_sys_sendmsg+0x19a/0x260 net/socket.c:2502
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f18bf9aa169
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 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:00007f18bdf1c168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f18bfac9f80 RCX: 00007f18bf9aa169
RDX: 0000000000000000 RSI: 0000000020000600 RDI: 0000000000000003
RBP: 00007f18bfa05ca1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd004b928f R14: 00007f18bdf1c300 R15: 0000000000022000
 </TASK>
team0: Port device wlan0 removed

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/04/15 07:03 linux-5.15.y 4fdad925aa1a ec410564 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in team_del_slave
* Struck through repros no longer work on HEAD.