================================ WARNING: inconsistent lock state 5.15.163-syzkaller #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz.1.4849/16987 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff8880b9b35bb8 (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_read_trylock include/linux/mmap_lock.h:137 [inline] do_user_addr_fault arch/x86/mm/fault.c:1298 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x564/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 irq event stamp: 24 hardirqs last enabled at (23): [] lock_page_memcg+0x264/0x4d0 mm/memcontrol.c:2056 hardirqs last disabled at (24): [] 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 *** 6 locks held by syz.1.4849/16987: #0: ffff88807c2ba428 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff88807c2ba428 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1298 [inline] #0: ffff88807c2ba428 (&mm->mmap_lock){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1445 [inline] #0: ffff88807c2ba428 (&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: ffff88801a40dc18 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline] #2: ffff88801a40dc18 (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+0x0/0x30 #4: ffffffff8c91fb20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 #5: ffff88807c2ba428 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #5: ffff88807c2ba428 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x23e/0x930 kernel/bpf/stackmap.c:185 stack backtrace: CPU: 1 PID: 16987 Comm: syz.1.4849 Not tainted 5.15.163-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/0x484 bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline] __bpf_prog_run include/linux/filter.h:621 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline] bpf_trace_run2+0x29e/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:instrument_atomic_read include/linux/instrumented.h:71 [inline] RIP: 0010:atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] RIP: 0010:lock_page_memcg+0x2cc/0x4d0 mm/memcontrol.c:2059 Code: 01 00 74 0a 48 8d 7c 24 60 e8 90 3f fb ff f6 44 24 61 02 0f 85 f9 00 00 00 41 f7 c4 00 02 00 00 74 01 fb 49 8d 9e 80 10 00 00 <48> 89 df be 04 00 00 00 e8 f7 40 fb ff 48 89 d8 48 c1 e8 03 48 b9 RSP: 0000:ffffc900030c7860 EFLAGS: 00000206 RAX: dffffc0000000000 RBX: ffff88814077d080 RCX: 1ffff92000618f18 RDX: dffffc0000000000 RSI: ffffffff8a8b2a00 RDI: ffffffff8ad8f700 RBP: ffffc900030c7948 R08: dffffc0000000000 R09: fffffbfff1f7f419 R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000246 R13: ffffea0001cc8878 R14: ffff88814077c000 R15: ffff88814077c670 page_add_file_rmap+0x18c/0x980 mm/rmap.c:1219 do_set_pte+0x45b/0x660 mm/memory.c:4039 filemap_map_pages+0xf5e/0x15c0 mm/filemap.c:3344 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:0x7fcb677d6910 Code: Unable to access opcode bytes at RIP 0x7fcb677d68e6. RSP: 002b:00007fcb662c0118 EFLAGS: 00010246 RAX: fffffffffffffeb8 RBX: 00007fcb662c06c0 RCX: 00007fcb67873ee9 RDX: 00007fcb662c0d78 RSI: 0000000000000058 RDI: 00007fcb662c06c0 RBP: 0000000000000000 R08: 00007fcb662c06c0 R09: 00007ffdd48eb4e7 R10: 0000000000000008 R11: 0000000000000202 R12: ffffffffffffffa8 R13: 000000000000000b R14: 00007ffdd48eb400 R15: 00007ffdd48eb4e8 ---------------- Code disassembly (best guess): 0: 01 00 add %eax,(%rax) 2: 74 0a je 0xe 4: 48 8d 7c 24 60 lea 0x60(%rsp),%rdi 9: e8 90 3f fb ff call 0xfffb3f9e e: f6 44 24 61 02 testb $0x2,0x61(%rsp) 13: 0f 85 f9 00 00 00 jne 0x112 19: 41 f7 c4 00 02 00 00 test $0x200,%r12d 20: 74 01 je 0x23 22: fb sti 23: 49 8d 9e 80 10 00 00 lea 0x1080(%r14),%rbx * 2a: 48 89 df mov %rbx,%rdi <-- trapping instruction 2d: be 04 00 00 00 mov $0x4,%esi 32: e8 f7 40 fb ff call 0xfffb412e 37: 48 89 d8 mov %rbx,%rax 3a: 48 c1 e8 03 shr $0x3,%rax 3e: 48 rex.W 3f: b9 .byte 0xb9