====================================================== WARNING: possible circular locking dependency detected 6.12.0-syzkaller-g7b1d1d4cfac0 #0 Not tainted ------------------------------------------------------ kworker/u8:4/218 is trying to acquire lock: ffff0000e0a18d40 (team->team_lock_key#15){+.+.}-{3:3}, at: team_del_slave+0x38/0x1a4 drivers/net/team/team_core.c:1990 but task is already holding lock: ffff0000f5cc0768 (&rdev->wiphy.mtx){+.+.}-{3:3}, at: wiphy_lock include/net/cfg80211.h:6014 [inline] ffff0000f5cc0768 (&rdev->wiphy.mtx){+.+.}-{3:3}, at: ieee80211_remove_interfaces+0x12c/0x5dc net/mac80211/iface.c:2275 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&rdev->wiphy.mtx){+.+.}-{3:3}: __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:804 wiphy_lock include/net/cfg80211.h:6014 [inline] ieee80211_open+0xe4/0x1e4 net/mac80211/iface.c:449 __dev_open+0x32c/0x500 net/core/dev.c:1476 dev_open+0xa8/0x248 net/core/dev.c:1512 team_port_add drivers/net/team/team_core.c:1216 [inline] team_add_slave+0x7b0/0x236c drivers/net/team/team_core.c:1976 do_set_master net/core/rtnetlink.c:2730 [inline] do_setlink+0xc30/0x3778 net/core/rtnetlink.c:2936 __rtnl_newlink net/core/rtnetlink.c:3725 [inline] rtnl_newlink+0x14c4/0x1bd0 net/core/rtnetlink.c:3772 rtnetlink_rcv_msg+0x630/0xa9c net/core/rtnetlink.c:6675 netlink_rcv_skb+0x214/0x3c4 net/netlink/af_netlink.c:2536 rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:6693 netlink_unicast_kernel net/netlink/af_netlink.c:1316 [inline] netlink_unicast+0x668/0x8a4 net/netlink/af_netlink.c:1342 netlink_sendmsg+0x7a4/0xa8c net/netlink/af_netlink.c:1886 sock_sendmsg_nosec net/socket.c:729 [inline] __sock_sendmsg net/socket.c:744 [inline] ____sys_sendmsg+0x56c/0x840 net/socket.c:2607 ___sys_sendmsg net/socket.c:2661 [inline] __sys_sendmsg+0x26c/0x33c net/socket.c:2690 __do_sys_sendmsg net/socket.c:2699 [inline] __se_sys_sendmsg net/socket.c:2697 [inline] __arm64_sys_sendmsg+0x80/0x94 net/socket.c:2697 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 -> #0 (team->team_lock_key#15){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x33f8/0x77c8 kernel/locking/lockdep.c:5202 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5825 __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:804 team_del_slave+0x38/0x1a4 drivers/net/team/team_core.c:1990 team_device_event+0x25c/0x4d4 drivers/net/team/team_core.c:2984 notifier_call_chain+0x1b4/0x538 kernel/notifier.c:93 raw_notifier_call_chain+0x3c/0x50 kernel/notifier.c:461 call_netdevice_notifiers_info net/core/dev.c:1996 [inline] call_netdevice_notifiers_extack net/core/dev.c:2034 [inline] call_netdevice_notifiers net/core/dev.c:2048 [inline] unregister_netdevice_many_notify+0xde0/0x1c64 net/core/dev.c:11407 unregister_netdevice_many net/core/dev.c:11469 [inline] unregister_netdevice_queue+0x2d8/0x324 net/core/dev.c:11343 unregister_netdevice include/linux/netdevice.h:3118 [inline] _cfg80211_unregister_wdev+0x15c/0x530 net/wireless/core.c:1211 cfg80211_unregister_wdev+0x24/0x34 net/wireless/core.c:1267 ieee80211_remove_interfaces+0x418/0x5dc net/mac80211/iface.c:2300 ieee80211_unregister_hw+0x60/0x29c net/mac80211/main.c:1671 mac80211_hwsim_del_radio+0x220/0x3e4 drivers/net/wireless/virtual/mac80211_hwsim.c:5625 hwsim_exit_net+0x51c/0x5e4 drivers/net/wireless/virtual/mac80211_hwsim.c:6505 ops_exit_list net/core/net_namespace.c:173 [inline] cleanup_net+0x640/0x9b4 net/core/net_namespace.c:626 process_one_work+0x7bc/0x1600 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x97c/0xeec kernel/workqueue.c:3391 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&rdev->wiphy.mtx); lock(team->team_lock_key#15); lock(&rdev->wiphy.mtx); lock(team->team_lock_key#15); *** DEADLOCK *** 5 locks held by kworker/u8:4/218: #0: ffff0000c1891948 ((wq_completion)netns){+.+.}-{0:0}, at: process_one_work+0x628/0x1600 kernel/workqueue.c:3203 #1: ffff80009bcf7c20 (net_cleanup_work){+.+.}-{0:0}, at: process_one_work+0x6bc/0x1600 kernel/workqueue.c:3203 #2: ffff8000927e7110 (pernet_ops_rwsem){++++}-{3:3}, at: cleanup_net+0x13c/0x9b4 net/core/net_namespace.c:580 #3: ffff8000927f3628 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock+0x20/0x2c net/core/rtnetlink.c:79 #4: ffff0000f5cc0768 (&rdev->wiphy.mtx){+.+.}-{3:3}, at: wiphy_lock include/net/cfg80211.h:6014 [inline] #4: ffff0000f5cc0768 (&rdev->wiphy.mtx){+.+.}-{3:3}, at: ieee80211_remove_interfaces+0x12c/0x5dc net/mac80211/iface.c:2275 stack backtrace: CPU: 1 UID: 0 PID: 218 Comm: kworker/u8:4 Not tainted 6.12.0-syzkaller-g7b1d1d4cfac0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: netns cleanup_net Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:484 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 print_circular_bug+0x154/0x1c0 kernel/locking/lockdep.c:2074 check_noncircular+0x310/0x404 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x33f8/0x77c8 kernel/locking/lockdep.c:5202 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5825 __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:804 team_del_slave+0x38/0x1a4 drivers/net/team/team_core.c:1990 team_device_event+0x25c/0x4d4 drivers/net/team/team_core.c:2984 notifier_call_chain+0x1b4/0x538 kernel/notifier.c:93 raw_notifier_call_chain+0x3c/0x50 kernel/notifier.c:461 call_netdevice_notifiers_info net/core/dev.c:1996 [inline] call_netdevice_notifiers_extack net/core/dev.c:2034 [inline] call_netdevice_notifiers net/core/dev.c:2048 [inline] unregister_netdevice_many_notify+0xde0/0x1c64 net/core/dev.c:11407 unregister_netdevice_many net/core/dev.c:11469 [inline] unregister_netdevice_queue+0x2d8/0x324 net/core/dev.c:11343 unregister_netdevice include/linux/netdevice.h:3118 [inline] _cfg80211_unregister_wdev+0x15c/0x530 net/wireless/core.c:1211 cfg80211_unregister_wdev+0x24/0x34 net/wireless/core.c:1267 ieee80211_remove_interfaces+0x418/0x5dc net/mac80211/iface.c:2300 ieee80211_unregister_hw+0x60/0x29c net/mac80211/main.c:1671 mac80211_hwsim_del_radio+0x220/0x3e4 drivers/net/wireless/virtual/mac80211_hwsim.c:5625 hwsim_exit_net+0x51c/0x5e4 drivers/net/wireless/virtual/mac80211_hwsim.c:6505 ops_exit_list net/core/net_namespace.c:173 [inline] cleanup_net+0x640/0x9b4 net/core/net_namespace.c:626 process_one_work+0x7bc/0x1600 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x97c/0xeec kernel/workqueue.c:3391 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 team0: Port device wlan1 removed hsr_slave_0: left promiscuous mode hsr_slave_1: left promiscuous mode batman_adv: batadv0: Interface deactivated: batadv_slave_0 batman_adv: batadv0: Removing interface: batadv_slave_0 batman_adv: batadv0: Interface deactivated: batadv_slave_1 batman_adv: batadv0: Removing interface: batadv_slave_1 hsr_slave_0: left promiscuous mode hsr_slave_1: left promiscuous mode batman_adv: batadv0: Interface deactivated: batadv_slave_0 batman_adv: batadv0: Removing interface: batadv_slave_0 batman_adv: batadv0: Interface deactivated: batadv_slave_1 batman_adv: batadv0: Removing interface: batadv_slave_1 hsr_slave_0: left promiscuous mode hsr_slave_1: left promiscuous mode batman_adv: batadv0: Interface deactivated: batadv_slave_0 batman_adv: batadv0: Removing interface: batadv_slave_0 batman_adv: batadv0: Interface deactivated: batadv_slave_1 batman_adv: batadv0: Removing interface: batadv_slave_1 veth1_macvtap: left promiscuous mode veth0_macvtap: left promiscuous mode veth1_vlan: left promiscuous mode veth0_vlan: left promiscuous mode veth1_macvtap: left promiscuous mode veth0_macvtap: left promiscuous mode veth1_vlan: left promiscuous mode veth0_vlan: left promiscuous mode veth1_macvtap: left promiscuous mode veth0_macvtap: left promiscuous mode veth1_vlan: left promiscuous mode veth0_vlan: left promiscuous mode team0 (unregistering): Port device team_slave_1 removed team0 (unregistering): Port device team_slave_0 removed