================================ WARNING: inconsistent lock state 5.10.0-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor.1/12861 [HC0[0]:SC1[1]:HE1:SE0] takes: ffff888012114ca8 (&file_data->lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] ffff888012114ca8 (&file_data->lock){+.?.}-{2:2}, at: io_file_data_ref_zero+0x78/0x4d0 fs/io_uring.c:7361 {SOFTIRQ-ON-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5437 [inline] lock_acquire+0x29d/0x750 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+0x355e/0x41f0 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: 4346 hardirqs last enabled at (4346): [] asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:628 hardirqs last disabled at (4345): [] sysvec_apic_timer_interrupt+0xc/0x100 arch/x86/kernel/apic/apic.c:1096 softirqs last enabled at (4054): [] asm_call_irq_on_stack+0xf/0x20 softirqs last disabled at (4319): [] 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 *** 2 locks held by syz-executor.1/12861: #0: ffffffff8b78df00 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2479 [inline] #0: ffffffff8b78df00 (rcu_callback){....}-{0:0}, at: rcu_core+0x6f4/0xf80 kernel/rcu/tree.c:2723 #1: ffffffff8b78e020 (rcu_read_lock){....}-{1:2}, at: percpu_ref_put_many.constprop.0+0x0/0x290 include/linux/cgroup.h:576 stack backtrace: CPU: 0 PID: 12861 Comm: syz-executor.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+0x107/0x163 lib/dump_stack.c:120 print_usage_bug kernel/locking/lockdep.c:4413 [inline] valid_state kernel/locking/lockdep.c:3751 [inline] mark_lock_irq kernel/locking/lockdep.c:3954 [inline] mark_lock.cold+0x56/0x73 kernel/locking/lockdep.c:4411 mark_usage kernel/locking/lockdep.c:4306 [inline] __lock_acquire+0x11b4/0x54b0 kernel/locking/lockdep.c:4786 lock_acquire kernel/locking/lockdep.c:5437 [inline] lock_acquire+0x29d/0x750 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+0x78/0x4d0 fs/io_uring.c:7361 percpu_ref_put_many.constprop.0+0x258/0x290 include/linux/percpu-refcount.h:322 rcu_do_batch kernel/rcu/tree.c:2489 [inline] rcu_core+0x75d/0xf80 kernel/rcu/tree.c:2723 __do_softirq+0x2bc/0xa77 kernel/softirq.c:343 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:226 [inline] __irq_exit_rcu+0x17f/0x200 kernel/softirq.c:420 irq_exit_rcu+0x5/0x20 kernel/softirq.c:432 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:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:169 [inline] RIP: 0010:_raw_spin_unlock_irq+0x25/0x40 kernel/locking/spinlock.c:199 Code: 0f 1f 44 00 00 55 48 8b 74 24 08 48 89 fd 48 83 c7 18 e8 ee 8e 3f f8 48 89 ef e8 36 42 40 f8 e8 a1 c2 5f f8 fb bf 01 00 00 00 a6 39 34 f8 65 8b 05 ef c1 e9 76 85 c0 74 02 5d c3 e8 0b 18 e8 RSP: 0018:ffffc90009837b60 EFLAGS: 00000206 RAX: 00000000000010dd RBX: 0000000000000001 RCX: 1ffffffff1afa231 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000001 RBP: ffff8880b9c34d00 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff8177f098 R11: 0000000000000000 R12: ffff8880b9c34d00 R13: ffff888027320400 R14: 0000000000000000 R15: ffff8880b9c34d18 finish_lock_switch kernel/sched/core.c:4079 [inline] finish_task_switch.isra.0+0x18b/0xbd0 kernel/sched/core.c:4196 context_switch kernel/sched/core.c:4330 [inline] __schedule+0x8f3/0x21b0 kernel/sched/core.c:5078 preempt_schedule_irq+0x4e/0x90 kernel/sched/core.c:5340 irqentry_exit_cond_resched kernel/entry/common.c:393 [inline] irqentry_exit_cond_resched kernel/entry/common.c:385 [inline] irqentry_exit+0x7a/0xa0 kernel/entry/common.c:423 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:628 RIP: 0010:__sanitizer_cov_trace_pc+0x37/0x60 kernel/kcov.c:197 Code: 81 e1 00 01 00 00 65 48 8b 14 25 00 f0 01 00 a9 00 01 ff 00 74 0e 85 c9 74 35 8b 82 cc 14 00 00 85 c0 74 2b 8b 82 a8 14 00 00 <83> f8 02 75 20 48 8b 8a b0 14 00 00 8b 92 ac 14 00 00 48 8b 01 48 RSP: 0018:ffffc90009837d68 EFLAGS: 00000246 RAX: 0000000000000002 RBX: ffffffff8b0d97b0 RCX: 0000000000000000 RDX: ffff88807ab043c0 RSI: ffffffff8383b2ae RDI: 0000000000000003 RBP: dffffc0000000000 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff8383b2a4 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000002 R14: ffffc90009837e50 R15: 0000000000000000 security_perf_event_open+0x5e/0xa0 security/security.c:2539 perf_allow_kernel include/linux/perf_event.h:1322 [inline] __do_sys_perf_event_open+0xa92/0x2ef0 kernel/events/core.c:11762 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45e149 Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f80cb660c68 EFLAGS: 00000246 ORIG_RAX: 000000000000012a RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 000000000045e149 RDX: ffffffffffffffff RSI: 0000000000000000 RDI: 0000000020000100 RBP: 000000000119bfd0 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffffffffffff R11: 0000000000000246 R12: 000000000119bf8c R13: 00007ffc68e5e10f R14: 00007f80cb6619c0 R15: 000000000119bf8c mceusb 4-1:0.0: Error: urb status = -71 mceusb 4-1:0.0: Error: urb status = -71 mceusb 4-1:0.0: Error: urb status = -71 mceusb 4-1:0.0: Error: urb status = -71 mceusb 4-1:0.0: Error: urb status = -71 mceusb 4-1:0.0: Error: urb status = -71 mceusb 4-1:0.0: Error: urb status = -71 mceusb 4-1:0.0: Error: urb status = -71 mceusb 4-1:0.0: Error: urb status = -71 mceusb 4-1:0.0: Error: urb status = -71 mceusb 4-1:0.0: Error: urb status = -71 mceusb 4-1:0.0: Error: urb status = -71 mceusb 4-1:0.0: Error: urb status = -71 mceusb 4-1:0.0: Error: urb status = -71 mceusb 4-1:0.0: Error: urb status = -71