================================ WARNING: inconsistent lock state 5.16.0-rc2-syzkaller #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz-executor.0/7423 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff88801cc78418 (&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: 724 hardirqs last enabled at (723): [] seqcount_lockdep_reader_access include/linux/seqlock.h:105 [inline] hardirqs last enabled at (723): [] read_seqbegin include/linux/seqlock.h:840 [inline] hardirqs last enabled at (723): [] zone_span_seqbegin include/linux/memory_hotplug.h:83 [inline] hardirqs last enabled at (723): [] page_outside_zone_boundaries mm/page_alloc.c:580 [inline] hardirqs last enabled at (723): [] bad_range+0x256/0x330 mm/page_alloc.c:607 hardirqs last disabled at (724): [] sysvec_apic_timer_interrupt+0xb/0xc0 arch/x86/kernel/apic/apic.c:1097 softirqs last enabled at (280): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last enabled at (280): [] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:636 softirqs last disabled at (233): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last disabled at (233): [] __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 *** 2 locks held by syz-executor.0/7423: #0: ffff888019a25378 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline] #0: ffff888019a25378 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pte_range mm/memory.c:1323 [inline] #0: ffff888019a25378 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pmd_range mm/memory.c:1467 [inline] #0: ffff888019a25378 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pud_range mm/memory.c:1496 [inline] #0: ffff888019a25378 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_p4d_range mm/memory.c:1517 [inline] #0: ffff888019a25378 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: unmap_page_range+0x86b/0x29f0 mm/memory.c:1538 #1: ffffffff8bb81120 (rcu_read_lock){....}-{1:2}, at: folio_memcg_lock+0x0/0x3e0 include/linux/cgroup.h:312 stack backtrace: CPU: 1 PID: 7423 Comm: syz-executor.0 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:lock_is_held_type+0xff/0x140 kernel/locking/lockdep.c:5685 Code: 00 00 b8 ff ff ff ff 65 0f c1 05 ac 65 be 76 83 f8 01 75 29 9c 58 f6 c4 02 75 3d 48 f7 04 24 00 02 00 00 74 01 fb 48 83 c4 08 <44> 89 e8 5b 5d 41 5c 41 5d 41 5e 41 5f c3 45 31 ed eb b9 0f 0b 48 RSP: 0018:ffffc900047cf698 EFLAGS: 00000282 RAX: 0000000000000046 RBX: 0000000000000002 RCX: 0000000000000001 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000000 RBP: ffffffff8bb81060 R08: 0000000000000000 R09: ffffffff8d90ed57 R10: fffffbfff1b21daa R11: 0000000000000000 R12: ffff8880228162c0 R13: 0000000000000000 R14: 00000000ffffffff R15: ffff888022816d48 lock_is_held include/linux/lockdep.h:283 [inline] rcu_read_lock_sched_held+0x3a/0x70 kernel/rcu/update.c:125 trace_lock_release include/trace/events/lock.h:58 [inline] lock_release+0x522/0x720 kernel/locking/lockdep.c:5648 zap_pte_range mm/memory.c:1357 [inline] zap_pmd_range mm/memory.c:1467 [inline] zap_pud_range mm/memory.c:1496 [inline] zap_p4d_range mm/memory.c:1517 [inline] unmap_page_range+0xf0e/0x29f0 mm/memory.c:1538 unmap_single_vma+0x198/0x310 mm/memory.c:1583 unmap_vmas+0x16b/0x2f0 mm/memory.c:1615 exit_mmap+0x1d0/0x630 mm/mmap.c:3170 __mmput+0x122/0x4b0 kernel/fork.c:1113 mmput+0x56/0x60 kernel/fork.c:1134 exit_mm kernel/exit.c:507 [inline] do_exit+0xb27/0x2b40 kernel/exit.c:819 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 RIP: 0033:0x7fd27d888ae9 Code: Unable to access opcode bytes at RIP 0x7fd27d888abf. RSP: 002b:00007fd27adfe218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007fd27d99bf68 RCX: 00007fd27d888ae9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fd27d99bf68 RBP: 00007fd27d99bf60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fd27d99bf6c R13: 00007fff5333f0ef R14: 00007fd27adfe300 R15: 0000000000022000 ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: b8 ff ff ff ff mov $0xffffffff,%eax 7: 65 0f c1 05 ac 65 be xadd %eax,%gs:0x76be65ac(%rip) # 0x76be65bb e: 76 f: 83 f8 01 cmp $0x1,%eax 12: 75 29 jne 0x3d 14: 9c pushfq 15: 58 pop %rax 16: f6 c4 02 test $0x2,%ah 19: 75 3d jne 0x58 1b: 48 f7 04 24 00 02 00 testq $0x200,(%rsp) 22: 00 23: 74 01 je 0x26 25: fb sti 26: 48 83 c4 08 add $0x8,%rsp * 2a: 44 89 e8 mov %r13d,%eax <-- trapping instruction 2d: 5b pop %rbx 2e: 5d pop %rbp 2f: 41 5c pop %r12 31: 41 5d pop %r13 33: 41 5e pop %r14 35: 41 5f pop %r15 37: c3 retq 38: 45 31 ed xor %r13d,%r13d 3b: eb b9 jmp 0xfffffff6 3d: 0f 0b ud2 3f: 48 rex.W