================================ WARNING: inconsistent lock state 5.15.164-syzkaller #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz.2.3/3659 [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_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: 70 hardirqs last enabled at (69): [] refill_stock+0x316/0x570 mm/memcontrol.c:2279 hardirqs last disabled at (70): [] 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 *** 3 locks held by syz.2.3/3659: #0: ffff888023723228 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff888023723228 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1298 [inline] #0: ffff888023723228 (&mm->mmap_lock){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1445 [inline] #0: ffff888023723228 (&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: ffff888023723228 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #2: ffff888023723228 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x23e/0x930 kernel/bpf/stackmap.c:185 stack backtrace: CPU: 0 PID: 3659 Comm: syz.2.3 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/0xb60 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:kasan_check_range+0x3/0x290 mm/kasan/generic.c:188 Code: 48 89 c7 e8 cf 7a 69 08 31 c0 c3 0f 0b b8 ea ff ff ff c3 0f 0b b8 ea ff ff ff c3 cc cc cc cc cc cc cc cc cc cc cc cc 55 41 57 <41> 56 53 b0 01 48 85 f6 0f 84 9a 01 00 00 48 89 fd 48 01 f5 0f 82 RSP: 0000:ffffc900030c7af0 EFLAGS: 00000246 RAX: dffffc0000000000 RBX: ffffea0001cdc100 RCX: ffffffff81cfa2b8 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffea0001cdc100 RBP: dffffc0000000000 R08: dffffc0000000000 R09: fffffbfff1bd2986 R10: 0000000000000000 R11: dffffc0000000001 R12: ffffea0001cdc108 R13: 00fff00000000000 R14: ffffea0001cdc100 R15: 0000000000000000 instrument_atomic_read include/linux/instrumented.h:71 [inline] test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline] PageSlab include/linux/page-flags.h:356 [inline] __page_memcg+0xb8/0x160 include/linux/memcontrol.h:406 page_memcg include/linux/memcontrol.h:459 [inline] commit_charge mm/memcontrol.c:2793 [inline] charge_memcg+0x180/0x340 mm/memcontrol.c:6747 __mem_cgroup_charge+0x23/0x80 mm/memcontrol.c:6778 mem_cgroup_charge include/linux/memcontrol.h:700 [inline] do_anonymous_page mm/memory.c:3812 [inline] handle_pte_fault mm/memory.c:4619 [inline] __handle_mm_fault mm/memory.c:4756 [inline] handle_mm_fault+0x2f90/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:0x7fd0b500fdfe Code: f6 31 c0 e8 24 ce 13 00 48 81 c4 90 00 00 00 48 98 5b c3 66 0f 1f 84 00 00 00 00 00 41 54 55 53 48 89 fb 48 81 ec d0 00 00 00 <48> 89 74 24 28 48 89 54 24 30 48 89 4c 24 38 4c 89 44 24 40 4c 89 RSP: 002b:00007fd0b35ccf80 EFLAGS: 00010202 RAX: 0000000000000000 RBX: 00007fd0b51bc9fe RCX: 00007fd0b51bdaa4 RDX: 0000000000001c39 RSI: 0000000000000000 RDI: 00007fd0b51bc9fe RBP: 00007fd0b51bb8e6 R08: 00007ffeefb080b0 R09: 0000000000000010 R10: 00007ffeefb08080 R11: 00000000000020fe R12: 00007fd0b51bca12 R13: 000000000000000b R14: 00007fd0b52dcf80 R15: 00007ffeefaf9438 ---------------- Code disassembly (best guess): 0: 48 89 c7 mov %rax,%rdi 3: e8 cf 7a 69 08 call 0x8697ad7 8: 31 c0 xor %eax,%eax a: c3 ret b: 0f 0b ud2 d: b8 ea ff ff ff mov $0xffffffea,%eax 12: c3 ret 13: 0f 0b ud2 15: b8 ea ff ff ff mov $0xffffffea,%eax 1a: c3 ret 1b: cc int3 1c: cc int3 1d: cc int3 1e: cc int3 1f: cc int3 20: cc int3 21: cc int3 22: cc int3 23: cc int3 24: cc int3 25: cc int3 26: cc int3 27: 55 push %rbp 28: 41 57 push %r15 * 2a: 41 56 push %r14 <-- trapping instruction 2c: 53 push %rbx 2d: b0 01 mov $0x1,%al 2f: 48 85 f6 test %rsi,%rsi 32: 0f 84 9a 01 00 00 je 0x1d2 38: 48 89 fd mov %rdi,%rbp 3b: 48 01 f5 add %rsi,%rbp 3e: 0f .byte 0xf 3f: 82 .byte 0x82