====================================================== WARNING: possible circular locking dependency detected 5.15.171-syzkaller #0 Not tainted ------------------------------------------------------ syz.0.51/4399 is trying to acquire lock: ffff88807cd789b8 (&trie->lock){....}-{2:2}, at: trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:450 but task is already holding lock: ffff8880b9135c68 (lock){..-.}-{2:2}, at: local_lock_acquire+0x7/0x130 include/linux/local_lock_internal.h:28 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (lock){..-.}-{2:2}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 local_lock_acquire+0x23/0x130 include/linux/local_lock_internal.h:29 rmqueue_pcplist mm/page_alloc.c:3699 [inline] rmqueue mm/page_alloc.c:3742 [inline] get_page_from_freelist+0x3227/0x3d40 mm/page_alloc.c:4189 __alloc_pages+0x272/0x700 mm/page_alloc.c:5464 stack_depot_save+0x319/0x440 lib/stackdepot.c:302 save_stack+0x104/0x1e0 mm/page_owner.c:120 __set_page_owner+0x37/0x300 mm/page_owner.c:181 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x3b78/0x3d40 mm/page_alloc.c:4192 __alloc_pages+0x272/0x700 mm/page_alloc.c:5464 __alloc_pages_node include/linux/gfp.h:570 [inline] alloc_pages_node include/linux/gfp.h:584 [inline] kmalloc_large_node+0x7c/0x180 mm/slub.c:4421 __kmalloc_node+0x22d/0x390 mm/slub.c:4437 kmalloc_node include/linux/slab.h:614 [inline] bpf_map_kmalloc_node+0xdb/0x160 kernel/bpf/syscall.c:430 lpm_trie_node_alloc kernel/bpf/lpm_trie.c:290 [inline] trie_update_elem+0x1cb/0xc00 kernel/bpf/lpm_trie.c:332 bpf_map_update_value+0x5d7/0x6c0 kernel/bpf/syscall.c:221 map_update_elem+0x6a0/0x7c0 kernel/bpf/syscall.c:1185 __sys_bpf+0x2fd/0x670 kernel/bpf/syscall.c:4639 __do_sys_bpf kernel/bpf/syscall.c:4755 [inline] __se_sys_bpf kernel/bpf/syscall.c:4753 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4753 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 -> #0 (&trie->lock){....}-{2:2}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162 trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:450 bpf_prog_2c29ac5cdc6b1842+0x3a/0x4e0 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:1878 [inline] bpf_trace_run1+0x168/0x2f0 kernel/trace/bpf_trace.c:1914 __bpf_trace_mm_page_free_batched+0x41/0x60 include/trace/events/kmem.h:182 trace_mm_page_free_batched include/trace/events/kmem.h:182 [inline] free_unref_page_list+0x79b/0x8e0 mm/page_alloc.c:3465 release_pages+0x1bb9/0x1f40 mm/swap.c:963 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu+0xc8/0x170 mm/mmu_gather.c:247 zap_pte_range mm/memory.c:1445 [inline] zap_pmd_range mm/memory.c:1494 [inline] zap_pud_range mm/memory.c:1523 [inline] zap_p4d_range mm/memory.c:1544 [inline] unmap_page_range+0x214d/0x2630 mm/memory.c:1565 unmap_vmas+0x1f8/0x390 mm/memory.c:1642 exit_mmap+0x3b6/0x670 mm/mmap.c:3186 __mmput+0x112/0x3b0 kernel/fork.c:1126 exit_mm+0x688/0x7f0 kernel/exit.c:550 do_exit+0x626/0x2480 kernel/exit.c:861 do_group_exit+0x144/0x310 kernel/exit.c:996 __do_sys_exit_group kernel/exit.c:1007 [inline] __se_sys_exit_group kernel/exit.c:1005 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1005 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 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(lock); lock(&trie->lock); lock(lock); lock(&trie->lock); *** DEADLOCK *** 2 locks held by syz.0.51/4399: #0: ffff8880b9135c68 (lock){..-.}-{2:2}, at: local_lock_acquire+0x7/0x130 include/linux/local_lock_internal.h:28 #1: ffffffff8c91fc60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 stack backtrace: CPU: 1 PID: 4399 Comm: syz.0.51 Not tainted 5.15.171-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2f8/0x3b0 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162 trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:450 bpf_prog_2c29ac5cdc6b1842+0x3a/0x4e0 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:1878 [inline] bpf_trace_run1+0x168/0x2f0 kernel/trace/bpf_trace.c:1914 __bpf_trace_mm_page_free_batched+0x41/0x60 include/trace/events/kmem.h:182 trace_mm_page_free_batched include/trace/events/kmem.h:182 [inline] free_unref_page_list+0x79b/0x8e0 mm/page_alloc.c:3465 release_pages+0x1bb9/0x1f40 mm/swap.c:963 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu+0xc8/0x170 mm/mmu_gather.c:247 zap_pte_range mm/memory.c:1445 [inline] zap_pmd_range mm/memory.c:1494 [inline] zap_pud_range mm/memory.c:1523 [inline] zap_p4d_range mm/memory.c:1544 [inline] unmap_page_range+0x214d/0x2630 mm/memory.c:1565 unmap_vmas+0x1f8/0x390 mm/memory.c:1642 exit_mmap+0x3b6/0x670 mm/mmap.c:3186 __mmput+0x112/0x3b0 kernel/fork.c:1126 exit_mm+0x688/0x7f0 kernel/exit.c:550 do_exit+0x626/0x2480 kernel/exit.c:861 do_group_exit+0x144/0x310 kernel/exit.c:996 __do_sys_exit_group kernel/exit.c:1007 [inline] __se_sys_exit_group kernel/exit.c:1005 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1005 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 RIP: 0033:0x7f57cdacc719 Code: Unable to access opcode bytes at RIP 0x7f57cdacc6ef. RSP: 002b:00007ffccfc94f28 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f57cdacc719 RDX: 0000000000000064 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007ffccfc94f7c R08: 00007ffccfc9500f R09: 0000000000012d23 R10: 00007f57cdc70000 R11: 0000000000000246 R12: 0000000000000032 R13: 0000000000012d23 R14: 0000000000012c9e R15: 00007ffccfc94fd0