================================ WARNING: inconsistent lock state 5.16.0-rc2-syzkaller #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz-executor.2/28313 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff888057d82418 (&ctx->timeout_lock){?.+.}-{2:2}, at: io_link_timeout_fn+0x69/0x390 fs/io_uring.c:6904 {HARDIRQ-ON-W} state was registered at: trace_hardirqs_on+0x6f/0x80 kernel/trace/trace_preemptirq.c:49 __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 spin_unlock_irq include/linux/spinlock.h:399 [inline] __io_poll_remove_one fs/io_uring.c:5669 [inline] io_poll_remove_one+0x248/0x610 fs/io_uring.c:5680 io_poll_remove_all+0x24c/0x319 fs/io_uring.c:5709 io_ring_ctx_wait_and_kill+0x22c/0x36a fs/io_uring.c:9534 io_uring_release+0x59/0x63 fs/io_uring.c:9554 __fput+0x3fc/0x870 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x209/0x220 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:300 do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae irq event stamp: 240 hardirqs last enabled at (239): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] hardirqs last enabled at (239): [] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 hardirqs last disabled at (240): [] sysvec_apic_timer_interrupt+0xa/0xb0 arch/x86/kernel/apic/apic.c:1097 softirqs last enabled at (86): [] local_bh_enable+0x5/0x20 include/linux/bottom_half.h:32 softirqs last disabled at (84): [] local_bh_disable+0x5/0x20 include/linux/bottom_half.h:19 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&ctx->timeout_lock); lock(&ctx->timeout_lock); *** DEADLOCK *** 1 lock held by syz-executor.2/28313: #0: ffff888057d820a8 (&ctx->uring_lock){+.+.}-{3:3}, at: __do_sys_io_uring_enter fs/io_uring.c:10042 [inline] #0: ffff888057d820a8 (&ctx->uring_lock){+.+.}-{3:3}, at: __se_sys_io_uring_enter+0x210/0x1cb0 fs/io_uring.c:9985 stack backtrace: CPU: 1 PID: 28313 Comm: syz-executor.2 Not tainted 5.16.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1dc/0x2d8 lib/dump_stack.c:106 print_usage_bug+0xa6d/0xea0 kernel/locking/lockdep.c:3933 mark_lock+0x168c/0x1e00 kernel/locking/lockdep.c:4605 mark_usage kernel/locking/lockdep.c:4497 [inline] __lock_acquire+0xbf5/0x2b00 kernel/locking/lockdep.c:4981 lock_acquire+0x19f/0x4d0 kernel/locking/lockdep.c:5637 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162 io_link_timeout_fn+0x69/0x390 fs/io_uring.c:6904 __run_hrtimer kernel/time/hrtimer.c:1685 [inline] __hrtimer_run_queues+0x50b/0xa60 kernel/time/hrtimer.c:1749 hrtimer_interrupt+0x3b3/0x1040 kernel/time/hrtimer.c:1811 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1086 [inline] __sysvec_apic_timer_interrupt+0xf9/0x270 arch/x86/kernel/apic/apic.c:1103 sysvec_apic_timer_interrupt+0x8c/0xb0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline] RIP: 0010:_raw_spin_unlock_irq+0x25/0x40 kernel/locking/spinlock.c:202 Code: 71 54 fd ff 90 53 48 89 fb 48 83 c7 18 48 8b 74 24 08 e8 5e 55 51 f7 48 89 df e8 66 06 53 f7 e8 21 5f 76 f7 fb bf 01 00 00 00 46 61 45 f7 65 8b 05 57 bb ed 75 85 c0 74 02 5b c3 e8 dc a2 eb RSP: 0018:ffffc900108bfa50 EFLAGS: 00000282 RAX: 62dab57d458c8c00 RBX: ffff888057d82400 RCX: ffffffff81665fb1 RDX: dffffc0000000000 RSI: 0000000000000001 RDI: 0000000000000001 RBP: ffff888057d82400 R08: dffffc0000000000 R09: fffffbfff1ff360a R10: fffffbfff1ff360a R11: 0000000000000000 R12: ffff888057d82190 R13: ffff888057d82188 R14: dffffc0000000000 R15: ffff888074310780 spin_unlock_irq include/linux/spinlock.h:399 [inline] io_queue_linked_timeout+0x239/0x3d0 fs/io_uring.c:6943 io_queue_sqe fs/io_uring.c:7018 [inline] io_submit_sqe fs/io_uring.c:7221 [inline] io_submit_sqes+0xffc/0xa7c0 fs/io_uring.c:7327 __do_sys_io_uring_enter fs/io_uring.c:10043 [inline] __se_sys_io_uring_enter+0x21f/0x1cb0 fs/io_uring.c:9985 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f7781cb5ae9 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f777f22b188 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa RAX: ffffffffffffffda RBX: 00007f7781dc8f60 RCX: 00007f7781cb5ae9 RDX: 0000000000000000 RSI: 00000000000045f5 RDI: 0000000000000003 RBP: 00007f7781d0ff6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdcc186c9f R14: 00007f777f22b300 R15: 0000000000022000 ---------------- Code disassembly (best guess): 0: 71 54 jno 0x56 2: fd std 3: ff 90 53 48 89 fb callq *-0x476b7ad(%rax) 9: 48 83 c7 18 add $0x18,%rdi d: 48 8b 74 24 08 mov 0x8(%rsp),%rsi 12: e8 5e 55 51 f7 callq 0xf7515575 17: 48 89 df mov %rbx,%rdi 1a: e8 66 06 53 f7 callq 0xf7530685 1f: e8 21 5f 76 f7 callq 0xf7765f45 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 46 61 45 f7 callq 0xf7456175 <-- trapping instruction 2f: 65 8b 05 57 bb ed 75 mov %gs:0x75edbb57(%rip),%eax # 0x75edbb8d 36: 85 c0 test %eax,%eax 38: 74 02 je 0x3c 3a: 5b pop %rbx 3b: c3 retq 3c: e8 .byte 0xe8 3d: dc .byte 0xdc 3e: a2 .byte 0xa2 3f: eb .byte 0xeb