====================================================== WARNING: possible circular locking dependency detected 6.1.143-syzkaller #0 Not tainted ------------------------------------------------------ syz.0.1102/10540 is trying to acquire lock: ffff88805a738a38 (&trie->lock){-.-.}-{2:2}, at: trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:467 but task is already holding lock: ffffffff8d1cb9e8 (depot_lock){-.-.}-{2:2}, at: __stack_depot_save+0x1e4/0x460 lib/stackdepot.c:479 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (depot_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 __stack_depot_save+0x1e4/0x460 lib/stackdepot.c:479 kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x60/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:936 [inline] __kmalloc_node+0xb0/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+0x5a0/0x670 kernel/bpf/syscall.c:226 generic_map_update_batch+0x569/0x850 kernel/bpf/syscall.c:1702 bpf_map_do_batch+0x466/0x600 kernel/bpf/syscall.c:-1 __sys_bpf+0x65f/0x6d0 kernel/bpf/syscall.c:-1 __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_2c29ac5cdc6b1842+0x3a/0x3e 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 __stack_depot_save+0x1e4/0x460 lib/stackdepot.c:479 kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x60/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x6b/0x80 mm/kasan/common.c:328 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 kmem_cache_zalloc include/linux/slab.h:689 [inline] fill_pool lib/debugobjects.c:169 [inline] debug_objects_fill_pool+0x32b/0x650 lib/debugobjects.c:607 __debug_object_init+0x29/0x420 lib/debugobjects.c:617 debug_timer_init kernel/time/timer.c:777 [inline] debug_init kernel/time/timer.c:825 [inline] init_timer_key+0x3e/0x320 kernel/time/timer.c:869 ccid2_hc_tx_init+0x2ad/0x460 net/dccp/ccids/ccid2.c:745 ccid_new+0x258/0x330 net/dccp/ccid.c:161 dccp_hdlr_ccid+0x24/0xe0 net/dccp/feat.c:39 __dccp_feat_activate net/dccp/feat.c:341 [inline] dccp_feat_activate_values+0x5c3/0xd80 net/dccp/feat.c:1555 dccp_rcv_request_sent_state_process+0x332/0x720 net/dccp/input.c:468 dccp_rcv_state_process+0x6ac/0x910 net/dccp/input.c:676 dccp_v4_do_rcv+0x116/0x1e0 net/dccp/ipv4.c:706 sk_backlog_rcv include/net/sock.h:1119 [inline] __release_sock+0x1b9/0x420 net/core/sock.c:2939 release_sock+0x5b/0x1b0 net/core/sock.c:3503 inet_wait_for_connect net/ipv4/af_inet.c:600 [inline] __inet_stream_connect+0x890/0xf50 net/ipv4/af_inet.c:694 inet_stream_connect+0x62/0xa0 net/ipv4/af_inet.c:739 __sys_connect_file net/socket.c:2011 [inline] __sys_connect+0x389/0x410 net/socket.c:2028 __do_sys_connect net/socket.c:2038 [inline] __se_sys_connect net/socket.c:2035 [inline] __x64_sys_connect+0x76/0x80 net/socket.c:2035 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(depot_lock); lock(&trie->lock); lock(depot_lock); lock(&trie->lock); *** DEADLOCK *** 3 locks held by syz.0.1102/10540: #0: ffff88805bf39ff0 (sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1756 [inline] #0: ffff88805bf39ff0 (sk_lock-AF_INET){+.+.}-{0:0}, at: inet_stream_connect+0x4d/0xa0 net/ipv4/af_inet.c:738 #1: ffffffff8d1cb9e8 (depot_lock){-.-.}-{2:2}, at: __stack_depot_save+0x1e4/0x460 lib/stackdepot.c:479 #2: ffffffff8cb2aaa0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #2: ffffffff8cb2aaa0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #2: ffffffff8cb2aaa0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2284 [inline] #2: ffffffff8cb2aaa0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0xda/0x3b0 kernel/trace/bpf_trace.c:2324 stack backtrace: CPU: 0 PID: 10540 Comm: syz.0.1102 Not tainted 6.1.143-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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_2c29ac5cdc6b1842+0x3a/0x3e 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 __stack_depot_save+0x1e4/0x460 lib/stackdepot.c:479 kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x60/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x6b/0x80 mm/kasan/common.c:328 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 kmem_cache_zalloc include/linux/slab.h:689 [inline] fill_pool lib/debugobjects.c:169 [inline] debug_objects_fill_pool+0x32b/0x650 lib/debugobjects.c:607 __debug_object_init+0x29/0x420 lib/debugobjects.c:617 debug_timer_init kernel/time/timer.c:777 [inline] debug_init kernel/time/timer.c:825 [inline] init_timer_key+0x3e/0x320 kernel/time/timer.c:869 ccid2_hc_tx_init+0x2ad/0x460 net/dccp/ccids/ccid2.c:745 ccid_new+0x258/0x330 net/dccp/ccid.c:161 dccp_hdlr_ccid+0x24/0xe0 net/dccp/feat.c:39 __dccp_feat_activate net/dccp/feat.c:341 [inline] dccp_feat_activate_values+0x5c3/0xd80 net/dccp/feat.c:1555 dccp_rcv_request_sent_state_process+0x332/0x720 net/dccp/input.c:468 dccp_rcv_state_process+0x6ac/0x910 net/dccp/input.c:676 dccp_v4_do_rcv+0x116/0x1e0 net/dccp/ipv4.c:706 sk_backlog_rcv include/net/sock.h:1119 [inline] __release_sock+0x1b9/0x420 net/core/sock.c:2939 release_sock+0x5b/0x1b0 net/core/sock.c:3503 inet_wait_for_connect net/ipv4/af_inet.c:600 [inline] __inet_stream_connect+0x890/0xf50 net/ipv4/af_inet.c:694 inet_stream_connect+0x62/0xa0 net/ipv4/af_inet.c:739 __sys_connect_file net/socket.c:2011 [inline] __sys_connect+0x389/0x410 net/socket.c:2028 __do_sys_connect net/socket.c:2038 [inline] __se_sys_connect net/socket.c:2035 [inline] __x64_sys_connect+0x76/0x80 net/socket.c:2035 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:0x7f05e6d8e929 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f05e7b41038 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 00007f05e6fb5fa0 RCX: 00007f05e6d8e929 RDX: 0000000000000010 RSI: 0000200000000080 RDI: 0000000000000004 RBP: 00007f05e6e10b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f05e6fb5fa0 R15: 00007ffdc1337418