================================ WARNING: inconsistent lock state 5.15.164-syzkaller #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz.3.25/3693 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff8880b9a35bb8 (lock#9){?.+.}-{2:2}, at: local_lock_acquire+0xd/0x170 include/linux/local_lock_internal.h:28 {HARDIRQ-ON-W} state was registered at: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 local_lock_acquire+0x29/0x170 include/linux/local_lock_internal.h:29 __mmap_lock_do_trace_acquire_returned+0x7c/0x340 mm/mmap_lock.c:237 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline] mmap_write_lock_killable include/linux/mmap_lock.h:88 [inline] vm_mmap_pgoff+0x2b0/0x2d0 mm/util.c:549 ksys_mmap_pgoff+0x559/0x780 mm/mmap.c:1624 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 irq event stamp: 14 hardirqs last enabled at (13): [] lock_page_memcg+0x264/0x4d0 mm/memcontrol.c:2056 hardirqs last disabled at (14): [] sysvec_call_function_single+0xa/0xb0 arch/x86/kernel/smp.c:243 softirqs last enabled at (0): [] copy_process+0x13b9/0x3ef0 kernel/fork.c:2151 softirqs last disabled at (0): [<0000000000000000>] 0x0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(lock#9); lock(lock#9); *** DEADLOCK *** 5 locks held by syz.3.25/3693: #0: ffff888023425528 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff888023425528 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1298 [inline] #0: ffff888023425528 (&mm->mmap_lock){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1445 [inline] #0: ffff888023425528 (&mm->mmap_lock){++++}-{3:3}, at: exc_page_fault+0x181/0x700 arch/x86/mm/fault.c:1501 #1: ffffffff8c91fb20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 #2: ffff88807a7323d8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline] #2: ffff88807a7323d8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: filemap_map_pages+0xbc5/0x15c0 mm/filemap.c:3324 #3: ffffffff8c91fb20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 #4: ffff888023425528 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #4: ffff888023425528 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x23e/0x930 kernel/bpf/stackmap.c:185 stack backtrace: CPU: 0 PID: 3693 Comm: syz.3.25 Not tainted 5.15.164-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 valid_state+0x134/0x1c0 kernel/locking/lockdep.c:3932 mark_lock_irq+0xa8/0xba0 kernel/locking/lockdep.c:4135 mark_lock+0x21a/0x340 kernel/locking/lockdep.c:4591 mark_usage kernel/locking/lockdep.c:4483 [inline] __lock_acquire+0xb5c/0x1ff0 kernel/locking/lockdep.c:4966 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 local_lock_acquire+0x29/0x170 include/linux/local_lock_internal.h:29 __mmap_lock_do_trace_acquire_returned+0x7c/0x340 mm/mmap_lock.c:237 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline] mmap_read_trylock include/linux/mmap_lock.h:137 [inline] stack_map_get_build_id_offset+0x612/0x930 kernel/bpf/stackmap.c:185 __bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:496 ____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1490 [inline] bpf_get_stack_raw_tp+0x1b2/0x220 kernel/trace/bpf_trace.c:1480 bpf_prog_ec3b2eefa702d8d3+0x3a/0x4f0 bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline] __bpf_prog_run include/linux/filter.h:628 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline] bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1917 trace_tlb_flush+0xed/0x110 include/trace/events/tlb.h:38 flush_tlb_func+0x480/0x590 arch/x86/mm/tlb.c:851 flush_smp_call_function_queue+0x2b5/0x760 kernel/smp.c:628 __sysvec_call_function_single+0x9a/0x250 arch/x86/kernel/smp.c:248 sysvec_call_function_single+0x89/0xb0 arch/x86/kernel/smp.c:243 asm_sysvec_call_function_single+0x16/0x20 arch/x86/include/asm/idtentry.h:646 RIP: 0010:get_current arch/x86/include/asm/current.h:15 [inline] RIP: 0010:write_comp_data kernel/kcov.c:217 [inline] RIP: 0010:__sanitizer_cov_trace_const_cmp8+0x4/0x80 kernel/kcov.c:291 Code: 89 f8 89 f6 48 c7 44 0a 08 05 00 00 00 48 89 44 0a 10 48 89 74 0a 18 4c 89 44 0a 20 49 ff c1 4c 89 09 c3 0f 1f 00 4c 8b 04 24 <65> 48 8b 0d 74 0a 82 7e 65 8b 05 75 0a 82 7e a9 00 01 ff 00 74 10 RSP: 0000:ffffc9000116fa40 EFLAGS: 00000246 RAX: 1ffffd4000392ae1 RBX: ffffea0001c95708 RCX: ffff88807b2fd940 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc9000116fc10 R08: ffffffff81a86427 R09: fffffbfff1bd2986 R10: 0000000000000000 R11: dffffc0000000001 R12: 00007fc649a0b000 R13: dffffc0000000000 R14: ffffea0001c956c8 R15: ffffea0001c95700 _compound_head include/linux/page-flags.h:198 [inline] unlock_page+0x47/0x200 mm/filemap.c:1510 filemap_map_pages+0xf66/0x15c0 mm/filemap.c:3347 do_fault_around mm/memory.c:4213 [inline] do_read_fault mm/memory.c:4228 [inline] do_fault mm/memory.c:4362 [inline] handle_pte_fault mm/memory.c:4621 [inline] __handle_mm_fault mm/memory.c:4756 [inline] handle_mm_fault+0x341b/0x5950 mm/memory.c:4854 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 RIP: 0033:0x7fc649a0b350 Code: Unable to access opcode bytes at RIP 0x7fc649a0b326. RSP: 002b:00007fc647ef3118 EFLAGS: 00010246 RAX: fffffffffffffeb8 RBX: 00007fc647ef36c0 RCX: 00007fc649aa8929 RDX: 00007fc647ef3d78 RSI: 0000000000000058 RDI: 00007fc647ef36c0 RBP: 0000000000000000 R08: 00007fc647ef36c0 R09: 00007ffc232a6987 R10: 0000000000000008 R11: 0000000000000206 R12: ffffffffffffffa8 R13: 000000000000000b R14: 00007ffc232a68a0 R15: 00007ffc232a6988 ---------------- Code disassembly (best guess): 0: 89 f8 mov %edi,%eax 2: 89 f6 mov %esi,%esi 4: 48 c7 44 0a 08 05 00 movq $0x5,0x8(%rdx,%rcx,1) b: 00 00 d: 48 89 44 0a 10 mov %rax,0x10(%rdx,%rcx,1) 12: 48 89 74 0a 18 mov %rsi,0x18(%rdx,%rcx,1) 17: 4c 89 44 0a 20 mov %r8,0x20(%rdx,%rcx,1) 1c: 49 ff c1 inc %r9 1f: 4c 89 09 mov %r9,(%rcx) 22: c3 ret 23: 0f 1f 00 nopl (%rax) 26: 4c 8b 04 24 mov (%rsp),%r8 * 2a: 65 48 8b 0d 74 0a 82 mov %gs:0x7e820a74(%rip),%rcx # 0x7e820aa6 <-- trapping instruction 31: 7e 32: 65 8b 05 75 0a 82 7e mov %gs:0x7e820a75(%rip),%eax # 0x7e820aae 39: a9 00 01 ff 00 test $0xff0100,%eax 3e: 74 10 je 0x50