====================================================== WARNING: possible circular locking dependency detected 6.14.0-syzkaller-11125-g609706855d90 #0 Not tainted ------------------------------------------------------ syz.4.211/7128 is trying to acquire lock: ffff888028bb8698 (kn->active#24){++++}-{0:0}, at: __kernfs_remove+0x281/0x6f0 fs/kernfs/dir.c:1487 but task is already holding lock: ffff888034750768 (&rdev->wiphy.mtx){+.+.}-{4:4}, at: class_wiphy_constructor include/net/cfg80211.h:6092 [inline] ffff888034750768 (&rdev->wiphy.mtx){+.+.}-{4:4}, at: ieee80211_remove_interfaces+0xf0/0x720 net/mac80211/iface.c:2291 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&rdev->wiphy.mtx){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:587 [inline] __mutex_lock+0x199/0xb90 kernel/locking/mutex.c:732 class_wiphy_constructor include/net/cfg80211.h:6092 [inline] ieee80211_change_mac+0x110/0x1480 net/mac80211/iface.c:307 netif_set_mac_address+0x309/0x4a0 net/core/dev.c:9600 dev_set_mac_address_user+0xc6/0x270 net/core/dev_api.c:94 dev_ifsioc+0x1457/0x1f70 net/core/dev_ioctl.c:577 dev_ioctl+0x223/0x10e0 net/core/dev_ioctl.c:821 sock_do_ioctl+0x19d/0x280 net/socket.c:1204 sock_ioctl+0x227/0x6b0 net/socket.c:1311 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x190/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (dev_addr_sem){++++}-{4:4}: down_read+0x9b/0x480 kernel/locking/rwsem.c:1524 address_show+0x23/0x2a0 net/core/net-sysfs.c:266 dev_attr_show+0x53/0xe0 drivers/base/core.c:2424 sysfs_kf_seq_show+0x23e/0x410 fs/sysfs/file.c:59 seq_read_iter+0x506/0x12c0 fs/seq_file.c:230 kernfs_fop_read_iter+0x40f/0x5a0 fs/kernfs/file.c:279 new_sync_read fs/read_write.c:489 [inline] vfs_read+0x8c8/0xc70 fs/read_write.c:570 ksys_read+0x12a/0x240 fs/read_write.c:713 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (kn->active#24){++++}-{0:0}: check_prev_add kernel/locking/lockdep.c:3166 [inline] check_prevs_add kernel/locking/lockdep.c:3285 [inline] validate_chain kernel/locking/lockdep.c:3909 [inline] __lock_acquire+0x1173/0x1ba0 kernel/locking/lockdep.c:5235 lock_acquire kernel/locking/lockdep.c:5866 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5823 kernfs_drain+0x4c8/0x5d0 fs/kernfs/dir.c:500 __kernfs_remove+0x281/0x6f0 fs/kernfs/dir.c:1487 kernfs_remove_by_name_ns+0xb2/0x170 fs/kernfs/dir.c:1695 kernfs_remove_by_name include/linux/kernfs.h:625 [inline] remove_files+0x96/0x1c0 fs/sysfs/group.c:28 sysfs_remove_group+0x8b/0x180 fs/sysfs/group.c:322 sysfs_remove_groups fs/sysfs/group.c:346 [inline] sysfs_remove_groups+0x60/0xa0 fs/sysfs/group.c:338 device_remove_groups drivers/base/core.c:2820 [inline] device_remove_attrs+0x203/0x290 drivers/base/core.c:2956 device_del+0x38e/0x9f0 drivers/base/core.c:3854 unregister_netdevice_many_notify+0x17eb/0x25a0 net/core/dev.c:12009 unregister_netdevice_many net/core/dev.c:12037 [inline] unregister_netdevice_queue+0x305/0x3f0 net/core/dev.c:11889 unregister_netdevice include/linux/netdevice.h:3374 [inline] _cfg80211_unregister_wdev+0x64b/0x830 net/wireless/core.c:1256 ieee80211_remove_interfaces+0x34e/0x720 net/mac80211/iface.c:2316 ieee80211_unregister_hw+0x55/0x3a0 net/mac80211/main.c:1681 mac80211_hwsim_del_radio drivers/net/wireless/virtual/mac80211_hwsim.c:5665 [inline] remove_user_radios drivers/net/wireless/virtual/mac80211_hwsim.c:6465 [inline] mac80211_hwsim_netlink_notify+0x2ea/0x8e0 drivers/net/wireless/virtual/mac80211_hwsim.c:6479 notifier_call_chain+0xb9/0x410 kernel/notifier.c:85 blocking_notifier_call_chain kernel/notifier.c:380 [inline] blocking_notifier_call_chain+0x69/0xa0 kernel/notifier.c:368 netlink_release+0x186b/0x2020 net/netlink/af_netlink.c:764 __sock_release+0xb0/0x270 net/socket.c:647 sock_close+0x1c/0x30 net/socket.c:1391 __fput+0x3ff/0xb70 fs/file_table.c:465 task_work_run+0x14d/0x240 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x27b/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x260 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: kn->active#24 --> 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#24); *** DEADLOCK *** 4 locks held by syz.4.211/7128: #0: ffff88805b0a5c08 (&sb->s_type->i_mutex_key#10){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:867 [inline] #0: ffff88805b0a5c08 (&sb->s_type->i_mutex_key#10){+.+.}-{4:4}, at: __sock_release+0x86/0x270 net/socket.c:646 #1: ffffffff901c1950 ((netlink_chain).rwsem){++++}-{4:4}, at: blocking_notifier_call_chain kernel/notifier.c:379 [inline] #1: ffffffff901c1950 ((netlink_chain).rwsem){++++}-{4:4}, at: blocking_notifier_call_chain+0x53/0xa0 kernel/notifier.c:368 #2: ffffffff90122128 (rtnl_mutex){+.+.}-{4:4}, at: ieee80211_unregister_hw+0x4d/0x3a0 net/mac80211/main.c:1674 #3: ffff888034750768 (&rdev->wiphy.mtx){+.+.}-{4:4}, at: class_wiphy_constructor include/net/cfg80211.h:6092 [inline] #3: ffff888034750768 (&rdev->wiphy.mtx){+.+.}-{4:4}, at: ieee80211_remove_interfaces+0xf0/0x720 net/mac80211/iface.c:2291 stack backtrace: CPU: 1 UID: 0 PID: 7128 Comm: syz.4.211 Not tainted 6.14.0-syzkaller-11125-g609706855d90 #0 PREEMPT(full) 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+0x116/0x1f0 lib/dump_stack.c:120 print_circular_bug+0x275/0x350 kernel/locking/lockdep.c:2079 check_noncircular+0x14c/0x170 kernel/locking/lockdep.c:2211 check_prev_add kernel/locking/lockdep.c:3166 [inline] check_prevs_add kernel/locking/lockdep.c:3285 [inline] validate_chain kernel/locking/lockdep.c:3909 [inline] __lock_acquire+0x1173/0x1ba0 kernel/locking/lockdep.c:5235 lock_acquire kernel/locking/lockdep.c:5866 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5823 kernfs_drain+0x4c8/0x5d0 fs/kernfs/dir.c:500 __kernfs_remove+0x281/0x6f0 fs/kernfs/dir.c:1487 kernfs_remove_by_name_ns+0xb2/0x170 fs/kernfs/dir.c:1695 kernfs_remove_by_name include/linux/kernfs.h:625 [inline] remove_files+0x96/0x1c0 fs/sysfs/group.c:28 sysfs_remove_group+0x8b/0x180 fs/sysfs/group.c:322 sysfs_remove_groups fs/sysfs/group.c:346 [inline] sysfs_remove_groups+0x60/0xa0 fs/sysfs/group.c:338 device_remove_groups drivers/base/core.c:2820 [inline] device_remove_attrs+0x203/0x290 drivers/base/core.c:2956 device_del+0x38e/0x9f0 drivers/base/core.c:3854 unregister_netdevice_many_notify+0x17eb/0x25a0 net/core/dev.c:12009 unregister_netdevice_many net/core/dev.c:12037 [inline] unregister_netdevice_queue+0x305/0x3f0 net/core/dev.c:11889 unregister_netdevice include/linux/netdevice.h:3374 [inline] _cfg80211_unregister_wdev+0x64b/0x830 net/wireless/core.c:1256 ieee80211_remove_interfaces+0x34e/0x720 net/mac80211/iface.c:2316 ieee80211_unregister_hw+0x55/0x3a0 net/mac80211/main.c:1681 mac80211_hwsim_del_radio drivers/net/wireless/virtual/mac80211_hwsim.c:5665 [inline] remove_user_radios drivers/net/wireless/virtual/mac80211_hwsim.c:6465 [inline] mac80211_hwsim_netlink_notify+0x2ea/0x8e0 drivers/net/wireless/virtual/mac80211_hwsim.c:6479 notifier_call_chain+0xb9/0x410 kernel/notifier.c:85 blocking_notifier_call_chain kernel/notifier.c:380 [inline] blocking_notifier_call_chain+0x69/0xa0 kernel/notifier.c:368 netlink_release+0x186b/0x2020 net/netlink/af_netlink.c:764 __sock_release+0xb0/0x270 net/socket.c:647 sock_close+0x1c/0x30 net/socket.c:1391 __fput+0x3ff/0xb70 fs/file_table.c:465 task_work_run+0x14d/0x240 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x27b/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x260 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe92bd8d169 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffe8bdf3a18 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 00007fe92bfa7ba0 RCX: 00007fe92bd8d169 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 00007fe92bfa7ba0 R08: 0000000000009c94 R09: 000000198bdf3d0f R10: 00007fe92bfa7ac0 R11: 0000000000000246 R12: 0000000000025eff R13: 00007fe92bfa6160 R14: ffffffffffffffff R15: 00007ffe8bdf3b30