====================================================== WARNING: possible circular locking dependency detected 6.1.147-syzkaller #0 Not tainted ------------------------------------------------------ modprobe/8129 is trying to acquire lock: ffff888027029a38 (&trie->lock){-.-.}-{2:2}, at: trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:467 but task is already holding lock: ffff8880174409d8 (&n->list_lock){-.-.}-{2:2}, at: __unfreeze_partials+0x71/0x200 mm/slub.c:2550 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&n->list_lock){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162 deactivate_slab+0x208/0x470 mm/slub.c:2489 ___slab_alloc+0x55b/0x1220 mm/slub.c:3147 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:935 [inline] __kmalloc_node+0xa0/0x240 mm/slab_common.c:943 kmalloc_array_node include/linux/slab.h:676 [inline] kcalloc_node include/linux/slab.h:681 [inline] memcg_alloc_slab_cgroups+0x83/0x120 mm/memcontrol.c:2889 account_slab mm/slab.h:635 [inline] allocate_slab mm/slub.c:1957 [inline] new_slab+0xc3/0x2c0 mm/slub.c:1992 ___slab_alloc+0xbc6/0x1220 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:935 [inline] __kmalloc_node+0xa0/0x240 mm/slab_common.c:943 kmalloc_node include/linux/slab.h:589 [inline] bpf_map_kmalloc_node+0xb8/0x1a0 kernel/bpf/syscall.c:452 lpm_trie_node_alloc kernel/bpf/lpm_trie.c:291 [inline] trie_update_elem+0x160/0xe90 kernel/bpf/lpm_trie.c:338 bpf_map_update_value+0x59e/0x670 kernel/bpf/syscall.c:226 map_update_elem+0x4d7/0x680 kernel/bpf/syscall.c:1466 __sys_bpf+0x454/0x6d0 kernel/bpf/syscall.c:5008 __do_sys_bpf kernel/bpf/syscall.c:5124 [inline] __se_sys_bpf kernel/bpf/syscall.c:5122 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5122 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&trie->lock){-.-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162 trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:467 bpf_prog_ae0c3e605f35524c+0x3d/0x41 bpf_dispatcher_nop_func include/linux/bpf.h:1001 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2285 [inline] bpf_trace_run2+0x1cd/0x3b0 kernel/trace/bpf_trace.c:2324 trace_contention_end+0x13f/0x190 include/trace/events/lock.h:122 __pv_queued_spin_lock_slowpath+0x7e8/0x9c0 kernel/locking/qspinlock.c:560 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [inline] queued_spin_lock_slowpath+0x43/0x50 arch/x86/include/asm/qspinlock.h:51 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline] do_raw_spin_lock+0x217/0x280 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0xb0/0xf0 kernel/locking/spinlock.c:162 __unfreeze_partials+0x71/0x200 mm/slub.c:2550 put_cpu_partial+0x17c/0x250 mm/slub.c:2662 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x144/0x160 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x1e/0x80 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737 slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x123/0x2f0 mm/slub.c:3422 vm_area_alloc+0x20/0xe0 kernel/fork.c:459 __mmap_region mm/mmap.c:2749 [inline] mmap_region+0xda0/0x1d30 mm/mmap.c:2912 do_mmap+0x894/0xf30 mm/mmap.c:1432 vm_mmap_pgoff+0x1b2/0x2b0 mm/util.c:520 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&n->list_lock); lock(&trie->lock); lock(&n->list_lock); lock(&trie->lock); *** DEADLOCK *** 4 locks held by modprobe/8129: #0: ffff888077d1f958 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline] #0: ffff888077d1f958 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x15d/0x2b0 mm/util.c:518 #1: ffffffff8cc1b610 (remove_cache_srcu){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #1: ffffffff8cc1b610 (remove_cache_srcu){....}-{0:0}, at: srcu_read_lock+0x16/0x40 include/linux/srcu.h:165 #2: ffff8880174409d8 (&n->list_lock){-.-.}-{2:2}, at: __unfreeze_partials+0x71/0x200 mm/slub.c:2550 #3: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #3: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #3: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2284 [inline] #3: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0xda/0x3b0 kernel/trace/bpf_trace.c:2324 stack backtrace: CPU: 0 PID: 8129 Comm: modprobe Not tainted 6.1.147-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106 check_noncircular+0x274/0x310 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162 trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:467 bpf_prog_ae0c3e605f35524c+0x3d/0x41 bpf_dispatcher_nop_func include/linux/bpf.h:1001 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2285 [inline] bpf_trace_run2+0x1cd/0x3b0 kernel/trace/bpf_trace.c:2324 trace_contention_end+0x13f/0x190 include/trace/events/lock.h:122 __pv_queued_spin_lock_slowpath+0x7e8/0x9c0 kernel/locking/qspinlock.c:560 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [inline] queued_spin_lock_slowpath+0x43/0x50 arch/x86/include/asm/qspinlock.h:51 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline] do_raw_spin_lock+0x217/0x280 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0xb0/0xf0 kernel/locking/spinlock.c:162 __unfreeze_partials+0x71/0x200 mm/slub.c:2550 put_cpu_partial+0x17c/0x250 mm/slub.c:2662 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x144/0x160 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x1e/0x80 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737 slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x123/0x2f0 mm/slub.c:3422 vm_area_alloc+0x20/0xe0 kernel/fork.c:459 __mmap_region mm/mmap.c:2749 [inline] mmap_region+0xda0/0x1d30 mm/mmap.c:2912 do_mmap+0x894/0xf30 mm/mmap.c:1432 vm_mmap_pgoff+0x1b2/0x2b0 mm/util.c:520 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f71b2107242 Code: 08 00 04 00 00 eb e2 90 41 f7 c1 ff 0f 00 00 75 27 55 89 cd 53 48 89 fb 48 85 ff 74 33 41 89 ea 48 89 df b8 09 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 5e 5b 5d c3 0f 1f 00 c7 05 46 40 01 00 16 00 RSP: 002b:00007ffe375a6f18 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f71b2107242 RDX: 0000000000000003 RSI: 0000000000002000 RDI: 0000000000000000 RBP: 0000000000000022 R08: 00000000ffffffff R09: 0000000000000000 R10: 0000000000000022 R11: 0000000000000246 R12: 0000000000002000 R13: 0000000000000000 R14: 0000000000000000 R15: 00007f71b211bf50