====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.1.369/5401 is trying to acquire lock: ffff888075c09a38 (&trie->lock){....}-{2:2}, at: trie_delete_elem+0x90/0x710 kernel/bpf/lpm_trie.c:467 but task is already holding lock: ffff8880b91280d8 (&base->lock){-.-.}-{2:2}, at: lock_timer_base+0x123/0x270 kernel/time/timer.c:946 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&base->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 lock_timer_base+0x123/0x270 kernel/time/timer.c:946 __mod_timer+0x117/0xd20 kernel/time/timer.c:1019 queue_delayed_work_on+0x126/0x1e0 kernel/workqueue.c:1715 queue_delayed_work include/linux/workqueue.h:527 [inline] schedule_delayed_work include/linux/workqueue.h:631 [inline] kvfree_call_rcu+0x4a9/0x7c0 kernel/rcu/tree.c:3629 rtnl_register_internal+0x489/0x590 net/core/rtnetlink.c:225 rtnl_register+0x2e/0x70 net/core/rtnetlink.c:275 ip_rt_init+0x2e0/0x3a0 net/ipv4/route.c:3798 ip_init+0xa/0x20 net/ipv4/ip_output.c:1749 inet_init+0x28b/0x3a0 net/ipv4/af_inet.c:2007 do_one_initcall+0x1ee/0x680 init/main.c:1316 do_initcall_level+0x137/0x1f0 init/main.c:1389 do_initcalls+0x4b/0x90 init/main.c:1405 kernel_init_freeable+0x3ce/0x560 init/main.c:1629 kernel_init+0x19/0x1b0 init/main.c:1520 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 -> #1 (krc.lock){..-.}-{2:2}: __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154 krc_this_cpu_lock kernel/rcu/tree.c:3203 [inline] add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3510 [inline] kvfree_call_rcu+0x186/0x7c0 kernel/rcu/tree.c:3601 trie_delete_elem+0x58c/0x710 kernel/bpf/lpm_trie.c:-1 0xffffffffa000ac72 bpf_dispatcher_nop_func include/linux/bpf.h:888 [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_run2+0x15b/0x2d0 kernel/trace/bpf_trace.c:1915 trace_tlb_flush+0xe6/0x110 include/trace/events/tlb.h:38 switch_mm_irqs_off+0x6e3/0x9a0 arch/x86/mm/tlb.c:-1 context_switch kernel/sched/core.c:5035 [inline] __schedule+0x1024/0x4390 kernel/sched/core.c:6395 preempt_schedule_irq+0xb1/0x150 kernel/sched/core.c:6799 irqentry_exit+0x63/0x70 kernel/entry/common.c:432 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676 __pte_needs_invert arch/x86/include/asm/pgtable-invert.h:18 [inline] protnone_mask arch/x86/include/asm/pgtable-invert.h:24 [inline] pmd_pfn arch/x86/include/asm/pgtable.h:193 [inline] pte_lockptr include/linux/mm.h:2228 [inline] do_anonymous_page mm/memory.c:3818 [inline] handle_pte_fault mm/memory.c:4648 [inline] __handle_mm_fault mm/memory.c:4785 [inline] handle_mm_fault+0x2e46/0x43b0 mm/memory.c:4883 do_user_addr_fault+0x489/0xc80 arch/x86/mm/fault.c:1357 handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606 copy_user_enhanced_fast_string+0xe/0x40 arch/x86/lib/copy_user_64.S:205 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_from_user arch/x86/include/asm/uaccess_64.h:52 [inline] _copy_from_user+0xfa/0x170 lib/usercopy.c:23 copy_from_user include/linux/uaccess.h:192 [inline] generic_map_update_batch+0x4d4/0x7c0 kernel/bpf/syscall.c:1427 bpf_map_do_batch+0x466/0x600 kernel/bpf/syscall.c:-1 __sys_bpf+0x601/0x670 kernel/bpf/syscall.c:-1 __do_sys_bpf kernel/bpf/syscall.c:4761 [inline] __se_sys_bpf kernel/bpf/syscall.c:4759 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4759 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 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 kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623 __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/0x710 kernel/bpf/lpm_trie.c:467 bpf_prog_2c29ac5cdc6b1842+0x3a/0x73c bpf_dispatcher_nop_func include/linux/bpf.h:888 [inline] __bpf_prog_run include/linux/filter.h:621 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1878 [inline] bpf_trace_run3+0x26e/0x320 kernel/trace/bpf_trace.c:1916 trace_timer_start include/trace/events/timer.h:52 [inline] enqueue_timer+0x394/0x520 kernel/time/timer.c:586 internal_add_timer kernel/time/timer.c:611 [inline] __mod_timer+0x8e1/0xd20 kernel/time/timer.c:1062 sk_reset_timer+0x1f/0xb0 net/core/sock.c:3142 tipc_sk_finish_conn+0x154/0x7e0 net/tipc/socket.c:1675 tipc_socketpair+0x250/0x470 net/tipc/socket.c:3348 __sys_socketpair+0x2ac/0x540 net/socket.c:1669 __do_sys_socketpair net/socket.c:1705 [inline] __se_sys_socketpair net/socket.c:1702 [inline] __x64_sys_socketpair+0x97/0xb0 net/socket.c:1702 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Chain exists of: &trie->lock --> krc.lock --> &base->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&base->lock); lock(krc.lock); lock(&base->lock); lock(&trie->lock); *** DEADLOCK *** 2 locks held by syz.1.369/5401: #0: ffff8880b91280d8 (&base->lock){-.-.}-{2:2}, at: lock_timer_base+0x123/0x270 kernel/time/timer.c:946 #1: ffffffff8c11c760 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:312 stack backtrace: CPU: 1 PID: 5401 Comm: syz.1.369 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 check_noncircular+0x274/0x310 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 kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623 __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/0x710 kernel/bpf/lpm_trie.c:467 bpf_prog_2c29ac5cdc6b1842+0x3a/0x73c bpf_dispatcher_nop_func include/linux/bpf.h:888 [inline] __bpf_prog_run include/linux/filter.h:621 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1878 [inline] bpf_trace_run3+0x26e/0x320 kernel/trace/bpf_trace.c:1916 trace_timer_start include/trace/events/timer.h:52 [inline] enqueue_timer+0x394/0x520 kernel/time/timer.c:586 internal_add_timer kernel/time/timer.c:611 [inline] __mod_timer+0x8e1/0xd20 kernel/time/timer.c:1062 sk_reset_timer+0x1f/0xb0 net/core/sock.c:3142 tipc_sk_finish_conn+0x154/0x7e0 net/tipc/socket.c:1675 tipc_socketpair+0x250/0x470 net/tipc/socket.c:3348 __sys_socketpair+0x2ac/0x540 net/socket.c:1669 __do_sys_socketpair net/socket.c:1705 [inline] __se_sys_socketpair net/socket.c:1702 [inline] __x64_sys_socketpair+0x97/0xb0 net/socket.c:1702 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fc572f536c9 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:00007fc5711ba038 EFLAGS: 00000246 ORIG_RAX: 0000000000000035 RAX: ffffffffffffffda RBX: 00007fc5731a9fa0 RCX: 00007fc572f536c9 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 000000000000001e RBP: 00007fc572fd5f91 R08: 0000000000000000 R09: 0000000000000000 R10: 00002000000010c0 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fc5731aa038 R14: 00007fc5731a9fa0 R15: 00007ffcddcb1be8