====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.0.16/6491 is trying to acquire lock: ffff8880742737f0 (&type->i_mutex_dir_key#6){++++}-{4:4}, at: inode_lock_shared include/linux/fs.h:1042 [inline] ffff8880742737f0 (&type->i_mutex_dir_key#6){++++}-{4:4}, at: lookup_slow+0x42/0x70 fs/namei.c:1874 but task is already holding lock: ffffffff8e286b68 (param_lock){+.+.}-{4:4}, at: kernel_param_lock kernel/params.c:608 [inline] ffffffff8e286b68 (param_lock){+.+.}-{4:4}, at: param_attr_store+0xec/0x300 kernel/params.c:587 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (param_lock){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:614 [inline] __mutex_lock+0x1aa/0x1ca0 kernel/locking/mutex.c:776 ieee80211_rate_control_ops_get net/mac80211/rate.c:223 [inline] rate_control_alloc net/mac80211/rate.c:269 [inline] ieee80211_init_rate_ctrl_alg+0x18d/0x680 net/mac80211/rate.c:1016 ieee80211_register_hw+0x21b5/0x4160 net/mac80211/main.c:1534 mac80211_hwsim_new_radio+0x3323/0x5150 drivers/net/wireless/virtual/mac80211_hwsim.c:5810 init_mac80211_hwsim+0x44e/0x920 drivers/net/wireless/virtual/mac80211_hwsim.c:7175 do_one_initcall+0x123/0x680 init/main.c:1378 do_initcall_level init/main.c:1440 [inline] do_initcalls init/main.c:1456 [inline] do_basic_setup init/main.c:1475 [inline] kernel_init_freeable+0x5c8/0x920 init/main.c:1688 kernel_init+0x1c/0x2b0 init/main.c:1578 ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 -> #2 (rtnl_mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:614 [inline] __mutex_lock+0x1aa/0x1ca0 kernel/locking/mutex.c:776 cgrp_css_online+0xa2/0x1f0 net/core/netprio_cgroup.c:157 online_css+0xb2/0x350 kernel/cgroup/cgroup.c:5734 css_create kernel/cgroup/cgroup.c:5822 [inline] cgroup_apply_control_enable+0x702/0xbb0 kernel/cgroup/cgroup.c:3391 cgroup_mkdir+0x5e0/0x12e0 kernel/cgroup/cgroup.c:6023 kernfs_iop_mkdir+0x111/0x190 fs/kernfs/dir.c:1271 vfs_mkdir+0x731/0xb60 fs/namei.c:5130 do_mkdirat+0x442/0x5e0 fs/namei.c:5164 __do_sys_mkdirat fs/namei.c:5186 [inline] __se_sys_mkdirat fs/namei.c:5184 [inline] __x64_sys_mkdirat+0x83/0xb0 fs/namei.c:5184 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (cgroup_mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:614 [inline] __mutex_lock+0x1aa/0x1ca0 kernel/locking/mutex.c:776 cgroup_lock include/linux/cgroup.h:394 [inline] cgroup_kn_lock_live+0x116/0x520 kernel/cgroup/cgroup.c:1735 cgroup_rmdir+0x20/0x290 kernel/cgroup/cgroup.c:6228 kernfs_iop_rmdir+0x106/0x170 fs/kernfs/dir.c:1289 vfs_rmdir fs/namei.c:5236 [inline] vfs_rmdir+0x382/0x840 fs/namei.c:5209 do_rmdir+0x3be/0x560 fs/namei.c:5291 __do_sys_rmdir fs/namei.c:5315 [inline] __se_sys_rmdir fs/namei.c:5313 [inline] __x64_sys_rmdir+0xc5/0x110 fs/namei.c:5313 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&type->i_mutex_dir_key#6){++++}-{4:4}: check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x1669/0x2890 kernel/locking/lockdep.c:5237 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x179/0x330 kernel/locking/lockdep.c:5825 down_read+0x9b/0x460 kernel/locking/rwsem.c:1537 inode_lock_shared include/linux/fs.h:1042 [inline] lookup_slow+0x42/0x70 fs/namei.c:1874 walk_component fs/namei.c:2221 [inline] lookup_last fs/namei.c:2722 [inline] path_lookupat+0x5e9/0xc40 fs/namei.c:2746 filename_lookup+0x224/0x5f0 fs/namei.c:2775 kern_path+0x35/0x50 fs/namei.c:2987 lookup_bdev+0xd8/0x280 block/bdev.c:1222 bdev_file_open_by_path+0x82/0x330 block/bdev.c:1095 add_device drivers/mtd/devices/block2mtd.c:279 [inline] block2mtd_setup2+0x317/0xe10 drivers/mtd/devices/block2mtd.c:459 block2mtd_setup+0xbd/0x110 drivers/mtd/devices/block2mtd.c:476 param_attr_store+0x199/0x300 kernel/params.c:589 module_attr_store+0x58/0x80 kernel/params.c:919 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:142 kernfs_fop_write_iter+0x3af/0x570 fs/kernfs/file.c:352 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x7d3/0x11d0 fs/read_write.c:686 ksys_write+0x12a/0x250 fs/read_write.c:738 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &type->i_mutex_dir_key#6 --> rtnl_mutex --> param_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(param_lock); lock(rtnl_mutex); lock(param_lock); rlock(&type->i_mutex_dir_key#6); *** DEADLOCK *** 5 locks held by syz.0.16/6491: #0: ffff88807cff4638 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x2a2/0x370 fs/file.c:1255 #1: ffff888035d6c420 (sb_writers#7){.+.+}-{0:0}, at: ksys_write+0x12a/0x250 fs/read_write.c:738 #2: ffff88802a4fb488 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x28f/0x570 fs/kernfs/file.c:343 #3: ffff88814d522788 (kn->active#4){.+.+}-{0:0}, at: kernfs_get_active_of fs/kernfs/file.c:80 [inline] #3: ffff88814d522788 (kn->active#4){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x2ff/0x570 fs/kernfs/file.c:344 #4: ffffffff8e286b68 (param_lock){+.+.}-{4:4}, at: kernel_param_lock kernel/params.c:608 [inline] #4: ffffffff8e286b68 (param_lock){+.+.}-{4:4}, at: param_attr_store+0xec/0x300 kernel/params.c:587 stack backtrace: CPU: 1 UID: 0 PID: 6491 Comm: syz.0.16 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/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/0x340 kernel/locking/lockdep.c:2043 check_noncircular+0x146/0x160 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x1669/0x2890 kernel/locking/lockdep.c:5237 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x179/0x330 kernel/locking/lockdep.c:5825 down_read+0x9b/0x460 kernel/locking/rwsem.c:1537 inode_lock_shared include/linux/fs.h:1042 [inline] lookup_slow+0x42/0x70 fs/namei.c:1874 walk_component fs/namei.c:2221 [inline] lookup_last fs/namei.c:2722 [inline] path_lookupat+0x5e9/0xc40 fs/namei.c:2746 filename_lookup+0x224/0x5f0 fs/namei.c:2775 kern_path+0x35/0x50 fs/namei.c:2987 lookup_bdev+0xd8/0x280 block/bdev.c:1222 bdev_file_open_by_path+0x82/0x330 block/bdev.c:1095 add_device drivers/mtd/devices/block2mtd.c:279 [inline] block2mtd_setup2+0x317/0xe10 drivers/mtd/devices/block2mtd.c:459 block2mtd_setup+0xbd/0x110 drivers/mtd/devices/block2mtd.c:476 param_attr_store+0x199/0x300 kernel/params.c:589 module_attr_store+0x58/0x80 kernel/params.c:919 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:142 kernfs_fop_write_iter+0x3af/0x570 fs/kernfs/file.c:352 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x7d3/0x11d0 fs/read_write.c:686 ksys_write+0x12a/0x250 fs/read_write.c:738 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f5f5678cda9 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:00007f5f5767c038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f5f569a5fa0 RCX: 00007f5f5678cda9 RDX: 0000000000000003 RSI: 0000000020000000 RDI: 0000000000000003 RBP: 00007f5f5680e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f5f569a5fa0 R15: 00007ffe28c1eb18 block2mtd: error: cannot open device 3QI