====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz-executor/4171 is trying to acquire lock: ffff888023220238 (&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_update_elem+0x86e/0xc50 kernel/bpf/lpm_trie.c:396 bpf_map_update_value+0x57d/0x650 kernel/bpf/syscall.c:223 generic_map_update_batch+0x525/0x7c0 kernel/bpf/syscall.c:1430 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_1db1603a7cfa36fb+0x3d/0xe64 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_run3+0x17e/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 __mod_timer+0x88e/0xd20 kernel/time/timer.c:1060 sk_reset_timer+0x1f/0xb0 net/core/sock.c:3142 tcp_event_new_data_sent+0x20e/0x370 net/ipv4/tcp_output.c:81 tcp_write_xmit+0x18f6/0x6580 net/ipv4/tcp_output.c:2725 __tcp_push_pending_frames+0x92/0x250 net/ipv4/tcp_output.c:2903 tcp_sendmsg_locked+0x2d96/0x3590 net/ipv4/tcp.c:1429 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1457 sock_sendmsg_nosec net/socket.c:706 [inline] __sock_sendmsg net/socket.c:718 [inline] sock_write_iter+0x29c/0x380 net/socket.c:1089 call_write_iter include/linux/fs.h:2173 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x712/0xd00 fs/read_write.c:594 ksys_write+0x14d/0x250 fs/read_write.c:647 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 *** 3 locks held by syz-executor/4171: #0: ffff888075739920 (sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1731 [inline] #0: ffff888075739920 (sk_lock-AF_INET){+.+.}-{0:0}, at: tcp_sendmsg+0x1d/0x40 net/ipv4/tcp.c:1456 #1: ffff8880b91280d8 (&base->lock){-.-.}-{2:2}, at: lock_timer_base+0x123/0x270 kernel/time/timer.c:946 #2: ffffffff8c11c760 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:312 stack backtrace: CPU: 1 PID: 4171 Comm: syz-executor 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_1db1603a7cfa36fb+0x3d/0xe64 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_run3+0x17e/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 __mod_timer+0x88e/0xd20 kernel/time/timer.c:1060 sk_reset_timer+0x1f/0xb0 net/core/sock.c:3142 tcp_event_new_data_sent+0x20e/0x370 net/ipv4/tcp_output.c:81 tcp_write_xmit+0x18f6/0x6580 net/ipv4/tcp_output.c:2725 __tcp_push_pending_frames+0x92/0x250 net/ipv4/tcp_output.c:2903 tcp_sendmsg_locked+0x2d96/0x3590 net/ipv4/tcp.c:1429 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1457 sock_sendmsg_nosec net/socket.c:706 [inline] __sock_sendmsg net/socket.c:718 [inline] sock_write_iter+0x29c/0x380 net/socket.c:1089 call_write_iter include/linux/fs.h:2173 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x712/0xd00 fs/read_write.c:594 ksys_write+0x14d/0x250 fs/read_write.c:647 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:0x7f20c08181c0 Code: 40 00 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 80 3d a1 d3 22 00 00 74 17 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 58 c3 0f 1f 80 00 00 00 00 48 83 ec 28 48 89 RSP: 002b:00007fff522a21f8 EFLAGS: 00000202 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000a408300 RCX: 00007f20c08181c0 RDX: 00000000000007e8 RSI: 00007f20ba289818 RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000000007 R09: 00000000003ffde8 R10: 55a9db68829ac628 R11: 0000000000000202 R12: 00000000000007e8 R13: 000055555e2b9400 R14: 00007fff522a26c0 R15: 00007f20ba289818