============================================ WARNING: possible recursive locking detected 5.15.167-syzkaller #0 Not tainted -------------------------------------------- syz-executor585/3604 is trying to acquire lock: ffff88807debe9b8 (&trie->lock){....}-{2:2}, at: trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:450 but task is already holding lock: ffff88807debe9b8 (&trie->lock){....}-{2:2}, at: trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:450 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&trie->lock); lock(&trie->lock); *** DEADLOCK *** May be due to missing lock nesting notation 4 locks held by syz-executor585/3604: #0: ffff88801fe8ce28 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff88801fe8ce28 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1298 [inline] #0: ffff88801fe8ce28 (&mm->mmap_lock){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1445 [inline] #0: ffff88801fe8ce28 (&mm->mmap_lock){++++}-{3:3}, at: exc_page_fault+0x181/0x700 arch/x86/mm/fault.c:1501 #1: ffffffff8c91fc60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 #2: ffff88807debe9b8 (&trie->lock){....}-{2:2}, at: trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:450 #3: ffffffff8c91fc60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 stack backtrace: CPU: 1 PID: 3604 Comm: syz-executor585 Not tainted 5.15.167-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 print_deadlock_bug kernel/locking/lockdep.c:2946 [inline] check_deadlock kernel/locking/lockdep.c:2989 [inline] validate_chain+0x46d2/0x5930 kernel/locking/lockdep.c:3775 __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_8c8ab8634bca3061+0x3a/0x4b0 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_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919 __bpf_trace_mm_page_alloc+0xba/0xe0 include/trace/events/kmem.h:201 trace_mm_page_alloc include/trace/events/kmem.h:201 [inline] __alloc_pages+0x6e0/0x700 mm/page_alloc.c:5445 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+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423 stack_depot_save+0x319/0x440 lib/stackdepot.c:302 kasan_save_stack+0x4d/0x60 mm/kasan/common.c:40 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348 kvfree_call_rcu+0x118/0x8a0 kernel/rcu/tree.c:3596 trie_delete_elem+0x520/0x690 bpf_prog_8c8ab8634bca3061+0x3a/0x4b0 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_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919 __bpf_trace_mm_page_alloc+0xba/0xe0 include/trace/events/kmem.h:201 trace_mm_page_alloc include/trace/events/kmem.h:201 [inline] __alloc_pages+0x6e0/0x700 mm/page_alloc.c:5445 alloc_pages_vma+0x39a/0x800 mm/mempolicy.c:2146 wp_page_copy+0x24e/0x2070 mm/memory.c:3026 handle_pte_fault mm/memory.c:4638 [inline] __handle_mm_fault mm/memory.c:4755 [inline] handle_mm_fault+0x2a3d/0x5960 mm/memory.c:4853 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:0x7fdb7c21d060 Code: 41 54 55 48 89 f5 53 89 fb 48 83 ec 18 48 83 3d 8d 0f 0a 00 00 89 54 24 0c 74 08 84 c9 0f 85 09 02 00 00 31 c0 ba 01 00 00 00 0f b1 15 80 3c 0a 00 0f 85 0f 02 00 00 4c 8d 25 73 3c 0a 00 4c RSP: 002b:00007fff44de24a0 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000001 RDX: 0000000000000001 RSI: 00007fdb7c2be120 RDI: 0000000000000000 RBP: 00007fdb7c2be120 R08: 0000000000000006 R09: 0000000000000006 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000001