================================ WARNING: inconsistent lock state 6.8.0-syzkaller-05236-g443574b03387 #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz-executor.3/5231 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff8880b9438528 (lock#10){?.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff8880b9438528 (lock#10){?.+.}-{2:2}, at: __mmap_lock_do_trace_acquire_returned+0x8f/0x600 mm/mmap_lock.c:237 {HARDIRQ-ON-W} state was registered at: lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] __mmap_lock_do_trace_acquire_returned+0xa8/0x600 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:166 [inline] get_mmap_lock_carefully mm/memory.c:5497 [inline] lock_mm_and_find_vma+0x213/0x2f0 mm/memory.c:5557 do_user_addr_fault arch/x86/mm/fault.c:1385 [inline] handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x1a9/0x890 arch/x86/mm/fault.c:1563 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 strncpy_from_user+0x110/0x2f0 lib/strncpy_from_user.c:139 bpf_prog_load+0xd65/0x20f0 kernel/bpf/syscall.c:2836 __sys_bpf+0x4ee/0x810 kernel/bpf/syscall.c:5631 __do_sys_bpf kernel/bpf/syscall.c:5738 [inline] __se_sys_bpf kernel/bpf/syscall.c:5736 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5736 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 irq event stamp: 32 hardirqs last enabled at (31): [] refill_stock+0x270/0x470 mm/memcontrol.c:2401 hardirqs last disabled at (32): [] sysvec_call_function_single+0xe/0xc0 arch/x86/kernel/smp.c:266 softirqs last enabled at (0): [] rcu_lock_acquire include/linux/rcupdate.h:298 [inline] softirqs last enabled at (0): [] rcu_read_lock include/linux/rcupdate.h:750 [inline] softirqs last enabled at (0): [] copy_process+0xa03/0x3df0 kernel/fork.c:2258 softirqs last disabled at (0): [<0000000000000000>] 0x0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(lock#10); lock(lock#10); *** DEADLOCK *** 2 locks held by syz-executor.3/5231: #0: ffffffff8e131920 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:298 [inline] #0: ffffffff8e131920 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:750 [inline] #0: ffffffff8e131920 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2380 [inline] #0: ffffffff8e131920 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x114/0x420 kernel/trace/bpf_trace.c:2420 #1: ffff88807cf994a0 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:165 [inline] #1: ffff88807cf994a0 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x237/0x9d0 kernel/bpf/stackmap.c:141 stack backtrace: CPU: 0 PID: 5231 Comm: syz-executor.3 Not tainted 6.8.0-syzkaller-05236-g443574b03387 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2e0 lib/dump_stack.c:106 valid_state+0x13a/0x1c0 kernel/locking/lockdep.c:4013 mark_lock_irq+0xbb/0xc20 kernel/locking/lockdep.c:4216 mark_lock+0x223/0x350 kernel/locking/lockdep.c:4678 mark_usage kernel/locking/lockdep.c:4564 [inline] __lock_acquire+0xb8e/0x1fd0 kernel/locking/lockdep.c:5091 lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] __mmap_lock_do_trace_acquire_returned+0xa8/0x600 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:166 [inline] stack_map_get_build_id_offset+0x9b2/0x9d0 kernel/bpf/stackmap.c:141 __bpf_get_stack+0x4ad/0x5a0 kernel/bpf/stackmap.c:449 ____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1985 [inline] bpf_get_stack_raw_tp+0x1a3/0x240 kernel/trace/bpf_trace.c:1975 bpf_prog_e6cf5f9c69743609+0x42/0x46 bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline] __bpf_prog_run include/linux/filter.h:657 [inline] bpf_prog_run include/linux/filter.h:664 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline] bpf_trace_run2+0x204/0x420 kernel/trace/bpf_trace.c:2420 trace_tlb_flush+0xfa/0x120 include/trace/events/tlb.h:38 flush_tlb_func+0x4e7/0x630 arch/x86/mm/tlb.c:895 csd_do_func kernel/smp.c:133 [inline] __flush_smp_call_function_queue+0x3ec/0x15b0 kernel/smp.c:511 __sysvec_call_function_single+0xa8/0x3e0 arch/x86/kernel/smp.c:271 instr_sysvec_call_function_single arch/x86/kernel/smp.c:266 [inline] sysvec_call_function_single+0x9e/0xc0 arch/x86/kernel/smp.c:266 asm_sysvec_call_function_single+0x1a/0x20 arch/x86/include/asm/idtentry.h:709 RIP: 0010:refill_stock+0x2bd/0x470 mm/memcontrol.c:2402 Code: 40 42 80 3c 2b 00 74 08 4c 89 f7 e8 ad 80 f7 ff f6 44 24 41 02 75 54 41 f7 c7 00 02 00 00 74 01 fb 48 c7 44 24 20 0e 36 e0 45 <4b> c7 44 25 00 00 00 00 00 66 43 c7 44 25 09 00 00 43 c6 44 25 0b RSP: 0018:ffffc90004cff180 EFLAGS: 00000206 RAX: 23aa114f3730c900 RBX: 1ffff9200099fe38 RCX: ffffffff944bf403 RDX: dffffc0000000000 RSI: ffffffff8baac220 RDI: ffffffff8bfec6e0 RBP: ffffc90004cff250 R08: ffffffff8f86ae6f R09: 1ffffffff1f0d5cd R10: dffffc0000000000 R11: fffffbfff1f0d5ce R12: 1ffff9200099fe34 R13: dffffc0000000000 R14: ffffc90004cff1c0 R15: 0000000000000246 try_charge_memcg+0x137e/0x18a0 mm/memcontrol.c:2866 obj_cgroup_charge_pages mm/memcontrol.c:3301 [inline] __memcg_kmem_charge_page+0xe2/0x250 mm/memcontrol.c:3327 __alloc_pages+0x28c/0x680 mm/page_alloc.c:4586 __alloc_pages_bulk+0x729/0xd40 mm/page_alloc.c:4517 alloc_pages_bulk_array_mempolicy+0x687/0x840 mm/mempolicy.c:2296 vm_area_alloc_pages mm/vmalloc.c:3100 [inline] __vmalloc_area_node mm/vmalloc.c:3211 [inline] __vmalloc_node_range+0x798/0x14a0 mm/vmalloc.c:3392 __vmalloc_node mm/vmalloc.c:3457 [inline] __vmalloc+0x79/0x90 mm/vmalloc.c:3471 bpf_prog_alloc_no_stats+0x4d/0x4a0 kernel/bpf/core.c:103 bpf_prog_alloc+0x3b/0x1b0 kernel/bpf/core.c:144 bpf_prog_load+0x7f7/0x20f0 kernel/bpf/syscall.c:2805 __sys_bpf+0x4ee/0x810 kernel/bpf/syscall.c:5631 __do_sys_bpf kernel/bpf/syscall.c:5738 [inline] __se_sys_bpf kernel/bpf/syscall.c:5736 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5736 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 RIP: 0033:0x7f835047de69 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f835118b0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f83505abf80 RCX: 00007f835047de69 RDX: 0000000000000090 RSI: 0000000020000280 RDI: 0000000000000005 RBP: 00007f83504ca47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f83505abf80 R15: 00007fff18ad68a8 ---------------- Code disassembly (best guess): 0: 40 rex 1: 42 80 3c 2b 00 cmpb $0x0,(%rbx,%r13,1) 6: 74 08 je 0x10 8: 4c 89 f7 mov %r14,%rdi b: e8 ad 80 f7 ff call 0xfff780bd 10: f6 44 24 41 02 testb $0x2,0x41(%rsp) 15: 75 54 jne 0x6b 17: 41 f7 c7 00 02 00 00 test $0x200,%r15d 1e: 74 01 je 0x21 20: fb sti 21: 48 c7 44 24 20 0e 36 movq $0x45e0360e,0x20(%rsp) 28: e0 45 * 2a: 4b c7 44 25 00 00 00 movq $0x0,0x0(%r13,%r12,1) <-- trapping instruction 31: 00 00 33: 66 43 c7 44 25 09 00 movw $0x0,0x9(%r13,%r12,1) 3a: 00 3b: 43 rex.XB 3c: c6 .byte 0xc6 3d: 44 rex.R 3e: 25 .byte 0x25 3f: 0b .byte 0xb