================================ WARNING: inconsistent lock state 5.16.0-rc2-syzkaller #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz-executor.3/19863 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff88801c0b3418 (&ctx->timeout_lock){?.+.}-{2:2}, at: io_link_timeout_fn+0x6b/0x470 fs/io_uring.c:6904 {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_uring_try_cancel_requests+0x66d/0x717 fs/io_uring.c:9668 io_uring_cancel_generic+0x3b8/0x690 fs/io_uring.c:9833 io_uring_files_cancel include/linux/io_uring.h:16 [inline] do_exit+0x60c/0x2b40 kernel/exit.c:787 do_group_exit+0x125/0x310 kernel/exit.c:929 get_signal+0x47d/0x2220 kernel/signal.c:2852 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x17d/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: 480 hardirqs last enabled at (479): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] hardirqs last enabled at (479): [] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 hardirqs last disabled at (480): [] sysvec_apic_timer_interrupt+0xb/0xc0 arch/x86/kernel/apic/apic.c:1097 softirqs last enabled at (202): [] read_pnet include/net/net_namespace.h:327 [inline] softirqs last enabled at (202): [] sock_net include/net/sock.h:2658 [inline] softirqs last enabled at (202): [] unix_create1+0x47c/0x5c0 net/unix/af_unix.c:893 softirqs last disabled at (200): [] unix_sockets_unbound net/unix/af_unix.c:134 [inline] softirqs last disabled at (200): [] unix_create1+0x3f9/0x5c0 net/unix/af_unix.c:890 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.3/19863: #0: ffff88801c0b30a8 (&ctx->uring_lock){+.+.}-{3:3}, at: __do_sys_io_uring_enter+0xf60/0x1f50 fs/io_uring.c:10042 stack backtrace: CPU: 3 PID: 19863 Comm: syz-executor.3 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_link_timeout_fn+0x6b/0x470 fs/io_uring.c:6904 __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:__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: 0f 1f 44 00 00 55 48 8b 74 24 08 48 89 fd 48 83 c7 18 e8 ae eb 14 f8 48 89 ef e8 f6 61 15 f8 e8 51 21 36 f8 fb bf 01 00 00 00 16 2c 08 f8 65 8b 05 2f 7a bb 76 85 c0 74 02 5d c3 e8 4b 4f b9 RSP: 0018:ffffc90002eefae8 EFLAGS: 00000202 RAX: 00000000000001df RBX: ffff88801c0b3000 RCX: 1ffffffff1ffd80e RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001 RBP: ffff88801c0b3400 R08: 0000000000000001 R09: ffffffff8ff75b3f R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000001 R13: ffff88801c0b3400 R14: ffff88801c0b3188 R15: ffff88801824d6d0 spin_unlock_irq include/linux/spinlock.h:399 [inline] io_queue_linked_timeout+0x292/0x430 fs/io_uring.c:6943 io_queue_sqe_arm_apoll+0x15d/0x1a0 fs/io_uring.c:6967 __io_queue_sqe fs/io_uring.c:6991 [inline] io_queue_sqe fs/io_uring.c:7018 [inline] io_submit_state_end fs/io_uring.c:7233 [inline] io_submit_sqes+0x7af2/0x8a20 fs/io_uring.c:7338 __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:0x7fcf0601fae9 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:00007fcf03595188 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa RAX: ffffffffffffffda RBX: 00007fcf06132f60 RCX: 00007fcf0601fae9 RDX: 0000000000000000 RSI: 00000000000045f5 RDI: 0000000000000003 RBP: 00007fcf06079f6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff9c0f35af R14: 00007fcf03595300 R15: 0000000000022000 ---------------- Code disassembly (best guess): 0: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 5: 55 push %rbp 6: 48 8b 74 24 08 mov 0x8(%rsp),%rsi b: 48 89 fd mov %rdi,%rbp e: 48 83 c7 18 add $0x18,%rdi 12: e8 ae eb 14 f8 callq 0xf814ebc5 17: 48 89 ef mov %rbp,%rdi 1a: e8 f6 61 15 f8 callq 0xf8156215 1f: e8 51 21 36 f8 callq 0xf8362175 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 16 2c 08 f8 callq 0xf8082c45 <-- trapping instruction 2f: 65 8b 05 2f 7a bb 76 mov %gs:0x76bb7a2f(%rip),%eax # 0x76bb7a65 36: 85 c0 test %eax,%eax 38: 74 02 je 0x3c 3a: 5d pop %rbp 3b: c3 retq 3c: e8 .byte 0xe8 3d: 4b rex.WXB 3e: 4f rex.WRXB 3f: b9 .byte 0xb9