====================================================== WARNING: possible circular locking dependency detected 6.14.0-rc7-syzkaller-00137-g5fc319360819 #0 Not tainted ------------------------------------------------------ syz.7.4095/21739 is trying to acquire lock: ffff88807d2800f8 (kn->active#26){++++}-{0:0}, at: __kernfs_remove+0x400/0x870 fs/kernfs/dir.c:1487 but task is already holding lock: ffff88805a648768 (&rdev->wiphy.mtx){+.+.}-{4:4}, at: class_wiphy_constructor include/net/cfg80211.h:6061 [inline] ffff88805a648768 (&rdev->wiphy.mtx){+.+.}-{4:4}, at: ieee80211_remove_interfaces+0x129/0x700 net/mac80211/iface.c:2281 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&rdev->wiphy.mtx){+.+.}-{4:4}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19c/0x1010 kernel/locking/mutex.c:730 class_wiphy_constructor include/net/cfg80211.h:6061 [inline] ieee80211_change_mac+0xc6/0x1160 net/mac80211/iface.c:307 dev_set_mac_address+0x327/0x510 net/core/dev.c:9515 dev_set_mac_address_user+0x31/0x50 net/core/dev.c:9534 do_setlink+0x784/0x4300 net/core/rtnetlink.c:3073 rtnl_setlink+0x824/0xbf0 net/core/rtnetlink.c:3430 rtnetlink_rcv_msg+0x791/0xcf0 net/core/rtnetlink.c:6912 netlink_rcv_skb+0x206/0x480 net/netlink/af_netlink.c:2533 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x7f6/0x990 net/netlink/af_netlink.c:1338 netlink_sendmsg+0x8de/0xcb0 net/netlink/af_netlink.c:1882 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:733 ____sys_sendmsg+0x53a/0x860 net/socket.c:2573 ___sys_sendmsg net/socket.c:2627 [inline] __sys_sendmsg+0x269/0x350 net/socket.c:2659 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 -> #1 (dev_addr_sem){++++}-{4:4}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 down_read+0xb1/0xa40 kernel/locking/rwsem.c:1524 address_show+0x25/0x250 net/core/net-sysfs.c:184 dev_attr_show+0x55/0xc0 drivers/base/core.c:2424 sysfs_kf_seq_show+0x331/0x4c0 fs/sysfs/file.c:59 seq_read_iter+0x43f/0xd70 fs/seq_file.c:230 new_sync_read fs/read_write.c:484 [inline] vfs_read+0x975/0xb40 fs/read_write.c:565 ksys_read+0x18f/0x2b0 fs/read_write.c:708 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 -> #0 (kn->active#26){++++}-{0:0}: check_prev_add kernel/locking/lockdep.c:3163 [inline] check_prevs_add kernel/locking/lockdep.c:3282 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3906 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5228 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 kernfs_drain+0x31c/0x6d0 fs/kernfs/dir.c:500 __kernfs_remove+0x400/0x870 fs/kernfs/dir.c:1487 kernfs_remove_by_name_ns+0xdc/0x160 fs/kernfs/dir.c:1695 kernfs_remove_by_name include/linux/kernfs.h:625 [inline] remove_files fs/sysfs/group.c:28 [inline] sysfs_remove_group+0xfe/0x2c0 fs/sysfs/group.c:322 sysfs_remove_groups+0x54/0xb0 fs/sysfs/group.c:346 device_remove_groups drivers/base/core.c:2820 [inline] device_remove_attrs+0x23a/0x290 drivers/base/core.c:2956 device_del+0x572/0x9b0 drivers/base/core.c:3854 unregister_netdevice_many_notify+0x19b4/0x1f10 net/core/dev.c:11923 unregister_netdevice_many net/core/dev.c:11951 [inline] unregister_netdevice_queue+0x303/0x370 net/core/dev.c:11821 unregister_netdevice include/linux/netdevice.h:3337 [inline] _cfg80211_unregister_wdev+0x163/0x590 net/wireless/core.c:1255 ieee80211_remove_interfaces+0x4ef/0x700 net/mac80211/iface.c:2306 ieee80211_unregister_hw+0x5d/0x2c0 net/mac80211/main.c:1681 mac80211_hwsim_del_radio+0x2c4/0x4c0 drivers/net/wireless/virtual/mac80211_hwsim.c:5664 remove_user_radios drivers/net/wireless/virtual/mac80211_hwsim.c:6464 [inline] mac80211_hwsim_netlink_notify+0x5de/0x930 drivers/net/wireless/virtual/mac80211_hwsim.c:6478 notifier_call_chain+0x1a5/0x3f0 kernel/notifier.c:85 blocking_notifier_call_chain+0x69/0x90 kernel/notifier.c:380 netlink_release+0x11ce/0x1b20 net/netlink/af_netlink.c:764 __sock_release net/socket.c:647 [inline] sock_close+0xbc/0x240 net/socket.c:1398 __fput+0x3e9/0x9f0 fs/file_table.c:464 __do_sys_close fs/open.c:1580 [inline] __se_sys_close fs/open.c:1565 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1565 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 other info that might help us debug this: Chain exists of: kn->active#26 --> dev_addr_sem --> &rdev->wiphy.mtx Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&rdev->wiphy.mtx); lock(dev_addr_sem); lock(&rdev->wiphy.mtx); lock(kn->active#26); *** DEADLOCK *** 4 locks held by syz.7.4095/21739: #0: ffff888030e96e08 (&sb->s_type->i_mutex_key#9){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:877 [inline] #0: ffff888030e96e08 (&sb->s_type->i_mutex_key#9){+.+.}-{4:4}, at: __sock_release net/socket.c:646 [inline] #0: ffff888030e96e08 (&sb->s_type->i_mutex_key#9){+.+.}-{4:4}, at: sock_close+0x90/0x240 net/socket.c:1398 #1: ffffffff8ff261f0 ((netlink_chain).rwsem){++++}-{4:4}, at: blocking_notifier_call_chain+0x53/0x90 kernel/notifier.c:379 #2: ffffffff8fec3c48 (rtnl_mutex){+.+.}-{4:4}, at: ieee80211_unregister_hw+0x55/0x2c0 net/mac80211/main.c:1674 #3: ffff88805a648768 (&rdev->wiphy.mtx){+.+.}-{4:4}, at: class_wiphy_constructor include/net/cfg80211.h:6061 [inline] #3: ffff88805a648768 (&rdev->wiphy.mtx){+.+.}-{4:4}, at: ieee80211_remove_interfaces+0x129/0x700 net/mac80211/iface.c:2281 stack backtrace: CPU: 1 UID: 0 PID: 21739 Comm: syz.7.4095 Not tainted 6.14.0-rc7-syzkaller-00137-g5fc319360819 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2076 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2208 check_prev_add kernel/locking/lockdep.c:3163 [inline] check_prevs_add kernel/locking/lockdep.c:3282 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3906 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5228 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 kernfs_drain+0x31c/0x6d0 fs/kernfs/dir.c:500 __kernfs_remove+0x400/0x870 fs/kernfs/dir.c:1487 kernfs_remove_by_name_ns+0xdc/0x160 fs/kernfs/dir.c:1695 kernfs_remove_by_name include/linux/kernfs.h:625 [inline] remove_files fs/sysfs/group.c:28 [inline] sysfs_remove_group+0xfe/0x2c0 fs/sysfs/group.c:322 sysfs_remove_groups+0x54/0xb0 fs/sysfs/group.c:346 device_remove_groups drivers/base/core.c:2820 [inline] device_remove_attrs+0x23a/0x290 drivers/base/core.c:2956 device_del+0x572/0x9b0 drivers/base/core.c:3854 unregister_netdevice_many_notify+0x19b4/0x1f10 net/core/dev.c:11923 unregister_netdevice_many net/core/dev.c:11951 [inline] unregister_netdevice_queue+0x303/0x370 net/core/dev.c:11821 unregister_netdevice include/linux/netdevice.h:3337 [inline] _cfg80211_unregister_wdev+0x163/0x590 net/wireless/core.c:1255 ieee80211_remove_interfaces+0x4ef/0x700 net/mac80211/iface.c:2306 ieee80211_unregister_hw+0x5d/0x2c0 net/mac80211/main.c:1681 mac80211_hwsim_del_radio+0x2c4/0x4c0 drivers/net/wireless/virtual/mac80211_hwsim.c:5664 remove_user_radios drivers/net/wireless/virtual/mac80211_hwsim.c:6464 [inline] mac80211_hwsim_netlink_notify+0x5de/0x930 drivers/net/wireless/virtual/mac80211_hwsim.c:6478 notifier_call_chain+0x1a5/0x3f0 kernel/notifier.c:85 blocking_notifier_call_chain+0x69/0x90 kernel/notifier.c:380 netlink_release+0x11ce/0x1b20 net/netlink/af_netlink.c:764 __sock_release net/socket.c:647 [inline] sock_close+0xbc/0x240 net/socket.c:1398 __fput+0x3e9/0x9f0 fs/file_table.c:464 __do_sys_close fs/open.c:1580 [inline] __se_sys_close fs/open.c:1565 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1565 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:0x7f5855d8bdca Code: 48 3d 00 f0 ff ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c 24 0c e8 43 91 02 00 8b 7c 24 0c 89 c2 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 36 89 d7 89 44 24 0c e8 a3 91 02 00 8b 44 24 RSP: 002b:00007f5853bf4f90 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: ffffffffffffffda RBX: 0000000000000036 RCX: 00007f5855d8bdca RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000009 RBP: 0000000000000009 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f5855fa6160 R15: 00007ffeae037d68