================================ WARNING: inconsistent lock state 5.10.0-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor.2/10711 [HC0[0]:SC1[1]:HE1:SE0] takes: ffff888142da4ea8 (&file_data->lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] ffff888142da4ea8 (&file_data->lock){+.?.}-{2:2}, at: io_file_data_ref_zero+0x75/0x480 fs/io_uring.c:7361 {SOFTIRQ-ON-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5437 [inline] lock_acquire+0x29d/0x740 kernel/locking/lockdep.c:5402 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:354 [inline] io_sqe_files_register fs/io_uring.c:7496 [inline] __io_uring_register fs/io_uring.c:9665 [inline] __do_sys_io_uring_register+0x343a/0x40d0 fs/io_uring.c:9755 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 irq event stamp: 2198 hardirqs last enabled at (2198): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (2198): [] _raw_spin_unlock_irqrestore+0x42/0x50 kernel/locking/spinlock.c:191 hardirqs last disabled at (2197): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (2197): [] _raw_spin_lock_irqsave+0x4e/0x50 kernel/locking/spinlock.c:159 softirqs last enabled at (0): [] copy_process+0x1bc4/0x6fc0 kernel/fork.c:2046 softirqs last disabled at (2039): [] asm_call_irq_on_stack+0xf/0x20 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&file_data->lock); lock(&file_data->lock); *** DEADLOCK *** 4 locks held by syz-executor.2/10711: #0: ffff888148110460 (sb_writers#4){.+.+}-{0:0}, at: filename_create+0x104/0x490 fs/namei.c:3462 #1: ffff888055ccc088 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:809 [inline] #1: ffff888055ccc088 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: filename_create+0x15a/0x490 fs/namei.c:3467 #2: ffffffff8b339140 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2479 [inline] #2: ffffffff8b339140 (rcu_callback){....}-{0:0}, at: rcu_core+0x582/0xf00 kernel/rcu/tree.c:2723 #3: ffffffff8b339260 (rcu_read_lock){....}-{1:2}, at: percpu_ref_put_many.constprop.0+0x0/0x250 net/netfilter/xt_cgroup.c:62 stack backtrace: CPU: 1 PID: 10711 Comm: syz-executor.2 Not tainted 5.10.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:120 print_usage_bug kernel/locking/lockdep.c:3740 [inline] valid_state kernel/locking/lockdep.c:3751 [inline] mark_lock_irq kernel/locking/lockdep.c:3954 [inline] mark_lock.cold+0x31/0x73 kernel/locking/lockdep.c:4411 mark_usage kernel/locking/lockdep.c:4306 [inline] __lock_acquire+0x11a5/0x5500 kernel/locking/lockdep.c:4786 lock_acquire kernel/locking/lockdep.c:5437 [inline] lock_acquire+0x29d/0x740 kernel/locking/lockdep.c:5402 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:354 [inline] io_file_data_ref_zero+0x75/0x480 fs/io_uring.c:7361 percpu_ref_put_many.constprop.0+0x217/0x250 include/linux/percpu-refcount.h:322 rcu_do_batch kernel/rcu/tree.c:2489 [inline] rcu_core+0x5eb/0xf00 kernel/rcu/tree.c:2723 __do_softirq+0x2a0/0x9f6 kernel/softirq.c:298 asm_call_irq_on_stack+0xf/0x20 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline] do_softirq_own_stack+0xaa/0xd0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:393 [inline] __irq_exit_rcu kernel/softirq.c:423 [inline] irq_exit_rcu+0x132/0x200 kernel/softirq.c:435 sysvec_apic_timer_interrupt+0x4d/0x100 arch/x86/kernel/apic/apic.c:1096 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:628 RIP: 0010:bytes_is_nonzero mm/kasan/generic.c:91 [inline] RIP: 0010:memory_is_nonzero mm/kasan/generic.c:108 [inline] RIP: 0010:memory_is_poisoned_n mm/kasan/generic.c:134 [inline] RIP: 0010:memory_is_poisoned mm/kasan/generic.c:165 [inline] RIP: 0010:check_memory_region_inline mm/kasan/generic.c:183 [inline] RIP: 0010:check_memory_region+0xde/0x180 mm/kasan/generic.c:192 Code: 74 f2 48 89 c2 b8 01 00 00 00 48 85 d2 75 56 5b 5d 41 5c c3 48 85 d2 74 5e 48 01 ea eb 09 48 83 c0 01 48 39 d0 74 50 80 38 00 <74> f2 eb d4 41 bc 08 00 00 00 48 89 ea 45 29 dc 4d 8d 1c 2c eb 0c RSP: 0018:ffffc90002c479a0 EFLAGS: 00000246 RAX: fffffbfff19d9451 RBX: fffffbfff19d9452 RCX: ffffffff81569018 RDX: fffffbfff19d9452 RSI: 0000000000000008 RDI: ffffffff8ceca288 RBP: fffffbfff19d9451 R08: 0000000000000000 R09: ffffffff8ceca28f R10: fffffbfff19d9451 R11: 0000000000000000 R12: 0000000000000002 R13: ffffffff8b339260 R14: 0000000000000000 R15: 0000000000000000 instrument_atomic_read include/linux/instrumented.h:71 [inline] test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline] cpumask_test_cpu include/linux/cpumask.h:373 [inline] trace_lock_acquire include/trace/events/lock.h:13 [inline] lock_acquire+0xb8/0x740 kernel/locking/lockdep.c:5408 rcu_lock_acquire include/linux/rcupdate.h:253 [inline] rcu_read_lock include/linux/rcupdate.h:642 [inline] ext4_get_group_desc+0x11c/0x4e0 fs/ext4/balloc.c:284 recently_deleted fs/ext4/ialloc.c:682 [inline] find_inode_bit+0x1b8/0x570 fs/ext4/ialloc.c:728 __ext4_new_inode+0xc35/0x5520 fs/ext4/ialloc.c:1062 ext4_symlink+0x3c9/0xd40 fs/ext4/namei.c:3333 vfs_symlink fs/namei.c:3960 [inline] vfs_symlink+0x44e/0x690 fs/namei.c:3946 do_symlinkat+0x258/0x2c0 fs/namei.c:3987 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45de87 Code: 0f 1f 00 b8 5c 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 cd b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 58 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ffdb1cb3498 EFLAGS: 00000202 ORIG_RAX: 0000000000000058 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000045de87 RDX: 00007ffdb1cb3533 RSI: 00000000004c3ba2 RDI: 00007ffdb1cb3520 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000013 R10: 0000000000000075 R11: 0000000000000202 R12: 0000000000000001 R13: 00007ffdb1cb34d0 R14: 00007ffdb1cb34e0 R15: 0000000000000001