====================================================== WARNING: possible circular locking dependency detected 5.15.186-syzkaller #0 Not tainted ------------------------------------------------------ udevd/4175 is trying to acquire lock: ffff8880b9127e78 (krc.lock){..-.}-{2:2}, at: krc_this_cpu_lock kernel/rcu/tree.c:3199 [inline] ffff8880b9127e78 (krc.lock){..-.}-{2:2}, at: add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3506 [inline] ffff8880b9127e78 (krc.lock){..-.}-{2:2}, at: kvfree_call_rcu+0x186/0x7c0 kernel/rcu/tree.c:3597 but task is already holding lock: ffff88807afb7db8 (&trie->lock){-...}-{2:2}, at: trie_delete_elem+0x90/0x710 kernel/bpf/lpm_trie.c:467 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&trie->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 trie_delete_elem+0x90/0x710 kernel/bpf/lpm_trie.c:467 bpf_prog_67a7f92a6a5e5f13+0xb32/0xe2c bpf_dispatcher_nop_func include/linux/bpf.h:790 [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_hrtimer_start include/trace/events/timer.h:199 [inline] debug_activate kernel/time/hrtimer.c:466 [inline] enqueue_hrtimer+0x314/0x370 kernel/time/hrtimer.c:1074 __hrtimer_start_range_ns kernel/time/hrtimer.c:1249 [inline] hrtimer_start_range_ns+0xa7e/0xc20 kernel/time/hrtimer.c:1291 hrtimer_start_expires include/linux/hrtimer.h:434 [inline] hrtimer_sleeper_start_expires kernel/time/hrtimer.c:1970 [inline] do_nanosleep+0x1a1/0x760 kernel/time/hrtimer.c:2046 hrtimer_nanosleep+0x2f7/0x520 kernel/time/hrtimer.c:2102 __do_sys_clock_nanosleep kernel/time/posix-timers.c:1314 [inline] __se_sys_clock_nanosleep+0x2e6/0x370 kernel/time/posix-timers.c:1291 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 -> #1 (hrtimer_bases.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_hrtimer_base kernel/time/hrtimer.c:168 [inline] hrtimer_start_range_ns+0xff/0xc20 kernel/time/hrtimer.c:1289 hrtimer_start include/linux/hrtimer.h:420 [inline] run_page_cache_worker kernel/rcu/tree.c:3488 [inline] kvfree_call_rcu+0x60d/0x7c0 kernel/rcu/tree.c:3599 rtnl_register_internal+0x44e/0x540 net/core/rtnetlink.c:223 rtnl_register+0x2e/0x70 net/core/rtnetlink.c:273 ip_rt_init+0x2e0/0x3a0 net/ipv4/route.c:3795 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:1302 do_initcall_level+0x137/0x1f0 init/main.c:1375 do_initcalls+0x4b/0x90 init/main.c:1391 kernel_init_freeable+0x3ce/0x560 init/main.c:1615 kernel_init+0x19/0x1b0 init/main.c:1506 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 -> #0 (krc.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 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:3199 [inline] add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3506 [inline] kvfree_call_rcu+0x186/0x7c0 kernel/rcu/tree.c:3597 trie_delete_elem+0x58c/0x710 kernel/bpf/lpm_trie.c:-1 bpf_prog_8c8ab8634bca3061+0x3a/0xd90 bpf_dispatcher_nop_func include/linux/bpf.h:790 [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 __bpf_trace_kmem_cache_free+0x99/0xc0 include/trace/events/kmem.h:138 trace_kmem_cache_free include/trace/events/kmem.h:138 [inline] kmem_cache_free+0x1e7/0x210 mm/slub.c:3516 file_free fs/file_table.c:55 [inline] __fput+0x627/0x930 fs/file_table.c:324 task_work_run+0x125/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Chain exists of: krc.lock --> hrtimer_bases.lock --> &trie->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&trie->lock); lock(hrtimer_bases.lock); lock(&trie->lock); lock(krc.lock); *** DEADLOCK *** 2 locks held by udevd/4175: #0: ffffffff8c11bfa0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 #1: ffff88807afb7db8 (&trie->lock){-...}-{2:2}, at: trie_delete_elem+0x90/0x710 kernel/bpf/lpm_trie.c:467 stack backtrace: CPU: 1 PID: 4175 Comm: udevd Not tainted 5.15.186-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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 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:3199 [inline] add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3506 [inline] kvfree_call_rcu+0x186/0x7c0 kernel/rcu/tree.c:3597 trie_delete_elem+0x58c/0x710 kernel/bpf/lpm_trie.c:-1 bpf_prog_8c8ab8634bca3061+0x3a/0xd90 bpf_dispatcher_nop_func include/linux/bpf.h:790 [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 __bpf_trace_kmem_cache_free+0x99/0xc0 include/trace/events/kmem.h:138 trace_kmem_cache_free include/trace/events/kmem.h:138 [inline] kmem_cache_free+0x1e7/0x210 mm/slub.c:3516 file_free fs/file_table.c:55 [inline] __fput+0x627/0x930 fs/file_table.c:324 task_work_run+0x125/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f89b7d0aa67 Code: 44 00 00 48 83 ec 10 48 63 ff 45 31 c9 45 31 c0 6a 01 31 c9 e8 ca 19 f9 ff 48 83 c4 18 c3 0f 1f 44 00 00 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 8b 15 61 b3 0d 00 f7 d8 64 89 02 b8 RSP: 002b:00007fff013c79c8 EFLAGS: 00000297 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000555b78434460 RCX: 00007f89b7d0aa67 RDX: 00007f89b7de4ea0 RSI: 0000555b78435950 RDI: 0000000000000009 RBP: 00007f89b7de4ff0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000297 R12: 0000000000000000 R13: 0000555b78434460 R14: 00007fff013c7a30 R15: 00007fff013c7a10