================================ WARNING: inconsistent lock state 5.16.0-rc2-syzkaller #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz-executor.2/11810 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff8880223da418 (&ctx->timeout_lock){?.+.}-{2:2}, at: io_timeout_fn+0x6f/0x360 fs/io_uring.c:5943 {HARDIRQ-ON-W} state was registered at: __trace_hardirqs_on_caller kernel/locking/lockdep.c:4224 [inline] lockdep_hardirqs_on_prepare kernel/locking/lockdep.c:4292 [inline] lockdep_hardirqs_on_prepare+0x135/0x400 kernel/locking/lockdep.c:4244 trace_hardirqs_on+0x5b/0x1c0 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 fs/io_uring.c:5654 [inline] io_poll_remove_one+0x236/0x870 fs/io_uring.c:5680 io_poll_remove_all+0x1af/0x235 fs/io_uring.c:5709 io_ring_ctx_wait_and_kill+0x1cc/0x322 fs/io_uring.c:9534 io_uring_release+0x42/0x46 fs/io_uring.c:9554 __fput+0x286/0x9f0 fs/file_table.c:280 task_work_run+0xdd/0x1a0 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+0x27e/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae irq event stamp: 2470 hardirqs last enabled at (2469): [] slab_alloc mm/slab.c:3317 [inline] hardirqs last enabled at (2469): [] __do_kmalloc mm/slab.c:3700 [inline] hardirqs last enabled at (2469): [] __kmalloc+0x37b/0x4d0 mm/slab.c:3711 hardirqs last disabled at (2470): [] sysvec_apic_timer_interrupt+0xb/0xc0 arch/x86/kernel/apic/apic.c:1097 softirqs last enabled at (2208): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last enabled at (2208): [] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:636 softirqs last disabled at (2181): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last disabled at (2181): [] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:636 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/11810: #0: ffff8880223da0a8 (&ctx->uring_lock){+.+.}-{3:3}, at: __do_sys_io_uring_enter+0xf60/0x1f50 fs/io_uring.c:10042 stack backtrace: CPU: 1 PID: 11810 Comm: syz-executor.2 Not tainted 5.16.0-rc2-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_usage_bug kernel/locking/lockdep.c:203 [inline] valid_state kernel/locking/lockdep.c:3945 [inline] mark_lock_irq kernel/locking/lockdep.c:4148 [inline] mark_lock.cold+0x61/0x8e kernel/locking/lockdep.c:4605 mark_usage kernel/locking/lockdep.c:4497 [inline] __lock_acquire+0x149d/0x54a0 kernel/locking/lockdep.c:4981 lock_acquire kernel/locking/lockdep.c:5637 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5602 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162 io_timeout_fn+0x6f/0x360 fs/io_uring.c:5943 __run_hrtimer kernel/time/hrtimer.c:1685 [inline] __hrtimer_run_queues+0x609/0xe50 kernel/time/hrtimer.c:1749 hrtimer_interrupt+0x31c/0x790 kernel/time/hrtimer.c:1811 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1086 [inline] __sysvec_apic_timer_interrupt+0x146/0x530 arch/x86/kernel/apic/apic.c:1103 sysvec_apic_timer_interrupt+0x8e/0xc0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:unwind_next_frame+0x4b6/0x1ce0 arch/x86/kernel/unwind_orc.c:464 Code: c0 e9 f4 fb ff ff 48 ba 00 00 00 00 00 fc ff df 4c 89 f9 48 c1 e9 03 0f b6 34 11 49 8d 4f 01 48 89 cf 48 c1 ef 03 0f b6 14 17 <4c> 89 ff 83 e7 07 40 38 fe 40 0f 9e c7 40 84 f6 40 0f 95 c6 40 84 RSP: 0018:ffffc90002d0f670 EFLAGS: 00000a07 RAX: 0000000000000015 RBX: 1ffff920005a1ed6 RCX: ffffffff8e178177 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 1ffffffff1c2f02e RBP: 0000000000000001 R08: ffffffff8e178172 R09: 0000000000000001 R10: fffff520005a1ef4 R11: 000000000008808a R12: ffffc90002d0f790 R13: ffffc90002d0f77d R14: ffffc90002d0f748 R15: ffffffff8e178176 arch_stack_walk+0x7d/0xe0 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x8c/0xc0 kernel/stacktrace.c:122 kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:269 [inline] __do_kmalloc mm/slab.c:3702 [inline] __kmalloc+0x209/0x4d0 mm/slab.c:3711 kmalloc include/linux/slab.h:595 [inline] io_alloc_async_data fs/io_uring.c:3334 [inline] io_timeout_prep+0x436/0x960 fs/io_uring.c:6151 io_req_prep fs/io_uring.c:6404 [inline] io_init_req fs/io_uring.c:7145 [inline] io_submit_sqe fs/io_uring.c:7155 [inline] io_submit_sqes+0x47a3/0x8a20 fs/io_uring.c:7327 __do_sys_io_uring_enter+0xf6e/0x1f50 fs/io_uring.c:10043 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f473abb7ae9 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:00007f473812d188 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa RAX: ffffffffffffffda RBX: 00007f473accaf60 RCX: 00007f473abb7ae9 RDX: 0000000000000000 RSI: 000000000000688c RDI: 0000000000000003 RBP: 00007f473ac11f6d R08: 0000000000000000 R09: 0000000000100000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff4223c7df R14: 00007f473812d300 R15: 0000000000022000 ---------------- Code disassembly (best guess), 1 bytes skipped: 0: e9 f4 fb ff ff jmpq 0xfffffbf9 5: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx c: fc ff df f: 4c 89 f9 mov %r15,%rcx 12: 48 c1 e9 03 shr $0x3,%rcx 16: 0f b6 34 11 movzbl (%rcx,%rdx,1),%esi 1a: 49 8d 4f 01 lea 0x1(%r15),%rcx 1e: 48 89 cf mov %rcx,%rdi 21: 48 c1 ef 03 shr $0x3,%rdi 25: 0f b6 14 17 movzbl (%rdi,%rdx,1),%edx * 29: 4c 89 ff mov %r15,%rdi <-- trapping instruction 2c: 83 e7 07 and $0x7,%edi 2f: 40 38 fe cmp %dil,%sil 32: 40 0f 9e c7 setle %dil 36: 40 84 f6 test %sil,%sil 39: 40 0f 95 c6 setne %sil 3d: 40 rex 3e: 84 .byte 0x84