================================ WARNING: inconsistent lock state 5.10.0-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. ksoftirqd/1/16 [HC0[0]:SC1[1]:HE1:SE0] takes: ffff888021b960a8 (&file_data->lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] ffff888021b960a8 (&file_data->lock){+.?.}-{2:2}, at: io_file_data_ref_zero+0x6a/0x3a0 fs/io_uring.c:7361 {SOFTIRQ-ON-W} state was registered at: lock_acquire+0x114/0x5e0 kernel/locking/lockdep.c:5437 __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 fs/io_uring.c:9755 [inline] __se_sys_io_uring_register+0x2416/0x2850 fs/io_uring.c:9737 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 irq event stamp: 27605044 hardirqs last enabled at (27605044): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (27605044): [] _raw_spin_unlock_irqrestore+0x2e/0x60 kernel/locking/spinlock.c:191 hardirqs last disabled at (27605043): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (27605043): [] _raw_spin_lock_irqsave+0x4d/0xa0 kernel/locking/spinlock.c:159 softirqs last enabled at (27605016): [] run_ksoftirqd+0x63/0xa0 kernel/softirq.c:653 softirqs last disabled at (27605021): [] run_ksoftirqd+0x63/0xa0 kernel/softirq.c:653 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&file_data->lock); lock(&file_data->lock); *** DEADLOCK *** 2 locks held by ksoftirqd/1/16: #0: ffffffff8bce8680 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire+0x0/0x20 kernel/rcu/tree.c:1374 #1: ffffffff8bce85c0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:252 stack backtrace: CPU: 1 PID: 16 Comm: ksoftirqd/1 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+0x137/0x1be lib/dump_stack.c:120 print_usage_bug+0xbfe/0x1080 kernel/locking/lockdep.c:3740 mark_lock_irq kernel/locking/lockdep.c:3751 [inline] mark_lock+0x182d/0x1ef0 kernel/locking/lockdep.c:4411 mark_usage kernel/locking/lockdep.c:4306 [inline] __lock_acquire+0xbe6/0x5e90 kernel/locking/lockdep.c:4786 lock_acquire+0x114/0x5e0 kernel/locking/lockdep.c:5437 __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+0x6a/0x3a0 fs/io_uring.c:7361 percpu_ref_put_many include/linux/percpu-refcount.h:322 [inline] percpu_ref_put+0x1cb/0x1d0 include/linux/percpu-refcount.h:338 rcu_do_batch kernel/rcu/tree.c:2489 [inline] rcu_core+0x7db/0x10c0 kernel/rcu/tree.c:2723 __do_softirq+0x307/0x6be kernel/softirq.c:298 run_ksoftirqd+0x63/0xa0 kernel/softirq.c:653 smpboot_thread_fn+0x572/0x970 kernel/smpboot.c:165 kthread+0x39a/0x3c0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296