====================================================== WARNING: possible circular locking dependency detected 6.9.0-rc7-syzkaller-00117-g448b3fe5a0ea #0 Not tainted ------------------------------------------------------ syz-executor.0/5224 is trying to acquire lock: ffff8880b9429430 (krc.lock){..-.}-{2:2}, at: krc_this_cpu_lock kernel/rcu/tree.c:2960 [inline] ffff8880b9429430 (krc.lock){..-.}-{2:2}, at: add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3359 [inline] ffff8880b9429430 (krc.lock){..-.}-{2:2}, at: kvfree_call_rcu+0x18a/0x790 kernel/rcu/tree.c:3444 but task is already holding lock: ffff888015fbe1f8 (&trie->lock){..-.}-{2:2}, at: trie_update_elem+0xcb/0xc10 kernel/bpf/lpm_trie.c:324 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&trie->lock){..-.}-{2:2}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 trie_delete_elem+0x96/0x6a0 kernel/bpf/lpm_trie.c:451 0xffffffffa0001da5 bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline] __bpf_prog_run include/linux/filter.h:657 [inline] bpf_prog_run include/linux/filter.h:664 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline] bpf_trace_run2+0x204/0x420 kernel/trace/bpf_trace.c:2420 __traceiter_timer_start+0x75/0xc0 include/trace/events/timer.h:52 trace_timer_start include/trace/events/timer.h:52 [inline] enqueue_timer+0x3ce/0x570 kernel/time/timer.c:664 internal_add_timer kernel/time/timer.c:689 [inline] __mod_timer+0xa0e/0xeb0 kernel/time/timer.c:1184 sk_reset_timer+0x23/0xc0 net/core/sock.c:3420 tipc_sk_finish_conn+0x16b/0x820 net/tipc/socket.c:1675 tipc_socketpair+0x25c/0x4b0 net/tipc/socket.c:3352 __sys_socketpair+0x40f/0x720 net/socket.c:1786 __do_sys_socketpair net/socket.c:1822 [inline] __se_sys_socketpair net/socket.c:1819 [inline] __x64_sys_socketpair+0x9b/0xb0 net/socket.c:1819 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&base->lock){-.-.}-{2:2}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 lock_timer_base+0x112/0x240 kernel/time/timer.c:1052 __mod_timer+0x1ca/0xeb0 kernel/time/timer.c:1133 queue_delayed_work_on+0x15a/0x260 kernel/workqueue.c:2608 kvfree_call_rcu+0x47f/0x790 kernel/rcu/tree.c:3472 rtnl_register_internal+0x482/0x590 net/core/rtnetlink.c:265 rtnl_register+0x36/0x80 net/core/rtnetlink.c:315 ip_rt_init+0x2f5/0x3a0 net/ipv4/route.c:3720 ip_init+0xe/0x20 net/ipv4/ip_output.c:1663 inet_init+0x3d8/0x580 net/ipv4/af_inet.c:2023 do_one_initcall+0x248/0x880 init/main.c:1245 do_initcall_level+0x157/0x210 init/main.c:1307 do_initcalls+0x3f/0x80 init/main.c:1323 kernel_init_freeable+0x435/0x5d0 init/main.c:1555 kernel_init+0x1d/0x2b0 init/main.c:1444 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #0 (krc.lock){..-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 krc_this_cpu_lock kernel/rcu/tree.c:2960 [inline] add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3359 [inline] kvfree_call_rcu+0x18a/0x790 kernel/rcu/tree.c:3444 trie_update_elem+0x819/0xc10 kernel/bpf/lpm_trie.c:385 bpf_map_update_value+0x4d3/0x540 kernel/bpf/syscall.c:203 generic_map_update_batch+0x60d/0x900 kernel/bpf/syscall.c:1876 bpf_map_do_batch+0x3e0/0x690 kernel/bpf/syscall.c:5174 __sys_bpf+0x377/0x810 __do_sys_bpf kernel/bpf/syscall.c:5767 [inline] __se_sys_bpf kernel/bpf/syscall.c:5765 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5765 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: krc.lock --> &base->lock --> &trie->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&trie->lock); lock(&base->lock); lock(&trie->lock); lock(krc.lock); *** DEADLOCK *** 2 locks held by syz-executor.0/5224: #0: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #0: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #0: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: bpf_map_update_value+0x3c4/0x540 kernel/bpf/syscall.c:202 #1: ffff888015fbe1f8 (&trie->lock){..-.}-{2:2}, at: trie_update_elem+0xcb/0xc10 kernel/bpf/lpm_trie.c:324 stack backtrace: CPU: 0 PID: 5224 Comm: syz-executor.0 Not tainted 6.9.0-rc7-syzkaller-00117-g448b3fe5a0ea #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 krc_this_cpu_lock kernel/rcu/tree.c:2960 [inline] add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3359 [inline] kvfree_call_rcu+0x18a/0x790 kernel/rcu/tree.c:3444 trie_update_elem+0x819/0xc10 kernel/bpf/lpm_trie.c:385 bpf_map_update_value+0x4d3/0x540 kernel/bpf/syscall.c:203 generic_map_update_batch+0x60d/0x900 kernel/bpf/syscall.c:1876 bpf_map_do_batch+0x3e0/0x690 kernel/bpf/syscall.c:5174 __sys_bpf+0x377/0x810 __do_sys_bpf kernel/bpf/syscall.c:5767 [inline] __se_sys_bpf kernel/bpf/syscall.c:5765 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5765 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f6e56e7dd69 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f6e569ff0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f6e56fabf80 RCX: 00007f6e56e7dd69 RDX: 0000000000000038 RSI: 0000000020000240 RDI: 000000000000001a RBP: 00007f6e56eca49e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f6e56fabf80 R15: 00007ffcb14b4c68