======================================================
WARNING: possible circular locking dependency detected
5.15.189-syzkaller #0 Not tainted
------------------------------------------------------
syz.4.668/6865 is trying to acquire lock:
ffff888078a655b8 (&trie->lock){-...}-{2:2}, at: trie_delete_elem+0x90/0x710 kernel/bpf/lpm_trie.c:467
but task is already holding lock:
ffff8880b902a218 (hrtimer_bases.lock){-.-.}-{2:2}, at: __run_hrtimer kernel/time/hrtimer.c:1694 [inline]
ffff8880b902a218 (hrtimer_bases.lock){-.-.}-{2:2}, at: __hrtimer_run_queues+0x5ff/0xc40 kernel/time/hrtimer.c:1754
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (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:3492 [inline]
kvfree_call_rcu+0x60d/0x7c0 kernel/rcu/tree.c:3603
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
-> #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:221
generic_map_update_batch+0x525/0x7c0 kernel/bpf/syscall.c:1424
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:4755 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4753 [inline]
__x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4753
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_44449317765ff86b+0x3e/0x2ec
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
__traceiter_hrtimer_start+0x6a/0xb0 include/trace/events/timer.h:199
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
__run_hrtimer kernel/time/hrtimer.c:1707 [inline]
__hrtimer_run_queues+0x65a/0xc40 kernel/time/hrtimer.c:1754
hrtimer_interrupt+0x3bb/0x8d0 kernel/time/hrtimer.c:1816
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1097 [inline]
__sysvec_apic_timer_interrupt+0x137/0x4a0 arch/x86/kernel/apic/apic.c:1114
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1108 [inline]
sysvec_apic_timer_interrupt+0x9b/0xc0 arch/x86/kernel/apic/apic.c:1108
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676
__sanitizer_cov_trace_pc+0x41/0x60 kernel/kcov.c:211
plist_check_list+0x20/0x240 lib/plist.c:45
plist_check_head lib/plist.c:60 [inline]
plist_del+0x66/0x3f0 lib/plist.c:114
__unqueue_futex+0xec/0x160 kernel/futex/core.c:1525
mark_wake_futex+0xe8/0x150 kernel/futex/core.c:1543
futex_wake+0x3a6/0x530 kernel/futex/core.c:1695
do_futex+0xcde/0x1240 kernel/futex/core.c:3987
__do_sys_futex kernel/futex/core.c:4059 [inline]
__se_sys_futex+0x3a3/0x430 kernel/futex/core.c:4040
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 --> hrtimer_bases.lock
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(hrtimer_bases.lock);
lock(krc.lock);
lock(hrtimer_bases.lock);
lock(&trie->lock);
*** DEADLOCK ***
3 locks held by syz.4.668/6865:
#0: ffffc90000e0c020 (&futex_queues[i].lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline]
#0: ffffc90000e0c020 (&futex_queues[i].lock){+.+.}-{2:2}, at: futex_wake+0x213/0x530 kernel/futex/core.c:1682
#1: ffff8880b902a218 (hrtimer_bases.lock){-.-.}-{2:2}, at: __run_hrtimer kernel/time/hrtimer.c:1694 [inline]
#1: ffff8880b902a218 (hrtimer_bases.lock){-.-.}-{2:2}, at: __hrtimer_run_queues+0x5ff/0xc40 kernel/time/hrtimer.c:1754
#2: ffffffff8c11c360 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311
stack backtrace:
CPU: 0 PID: 6865 Comm: syz.4.668 Not tainted 5.15.189-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/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_44449317765ff86b+0x3e/0x2ec
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
__traceiter_hrtimer_start+0x6a/0xb0 include/trace/events/timer.h:199
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
__run_hrtimer kernel/time/hrtimer.c:1707 [inline]
__hrtimer_run_queues+0x65a/0xc40 kernel/time/hrtimer.c:1754
hrtimer_interrupt+0x3bb/0x8d0 kernel/time/hrtimer.c:1816
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1097 [inline]
__sysvec_apic_timer_interrupt+0x137/0x4a0 arch/x86/kernel/apic/apic.c:1114
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1108 [inline]
sysvec_apic_timer_interrupt+0x9b/0xc0 arch/x86/kernel/apic/apic.c:1108
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676
RIP: 0010:__sanitizer_cov_trace_pc+0x41/0x60 kernel/kcov.c:211
Code: ff 00 74 11 81 fa 00 01 00 00 75 35 83 b9 34 16 00 00 00 74 2c 8b 91 10 16 00 00 83 fa 02 75 21 48 8b 91 18 16 00 00 48 8b 32 <48> 8d 7e 01 8b 89 14 16 00 00 48 39 cf 73 08 48 89 44 f2 08 48 89
RSP: 0018:ffffc90003aafa70 EFLAGS: 00000246
RAX: ffffffff83fc2d30 RBX: dffffc0000000000 RCX: ffff888079ea1dc0
RDX: ffffc9000f0ee000 RSI: 0000000000000406 RDI: ffffc90000e0c048
RBP: ffffc90000e0c048 R08: dffffc0000000000 R09: ffffed1003b8a776
R10: ffffed1003b8a776 R11: 1ffff11003b8a775 R12: dffffc0000000000
R13: ffffc900013afbe0 R14: ffffc900013afbb0 R15: ffffc900013afbb8
plist_check_list+0x20/0x240 lib/plist.c:45
plist_check_head lib/plist.c:60 [inline]
plist_del+0x66/0x3f0 lib/plist.c:114
__unqueue_futex+0xec/0x160 kernel/futex/core.c:1525
mark_wake_futex+0xe8/0x150 kernel/futex/core.c:1543
futex_wake+0x3a6/0x530 kernel/futex/core.c:1695
do_futex+0xcde/0x1240 kernel/futex/core.c:3987
__do_sys_futex kernel/futex/core.c:4059 [inline]
__se_sys_futex+0x3a3/0x430 kernel/futex/core.c:4040
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:0x7fd4fb7e1be9
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:00007fd4f9a280e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: ffffffffffffffda RBX: 00007fd4fba09098 RCX: 00007fd4fb7e1be9
RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007fd4fba0909c
RBP: 00007fd4fba09090 R08: 00213754d11aa8b2 R09: 0000000000000000
R10: 000000000000000d R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd4fba09128 R14: 00007ffcdc83d7c0 R15: 00007ffcdc83d8a8
----------------
Code disassembly (best guess):
0: ff 00 incl (%rax)
2: 74 11 je 0x15
4: 81 fa 00 01 00 00 cmp $0x100,%edx
a: 75 35 jne 0x41
c: 83 b9 34 16 00 00 00 cmpl $0x0,0x1634(%rcx)
13: 74 2c je 0x41
15: 8b 91 10 16 00 00 mov 0x1610(%rcx),%edx
1b: 83 fa 02 cmp $0x2,%edx
1e: 75 21 jne 0x41
20: 48 8b 91 18 16 00 00 mov 0x1618(%rcx),%rdx
27: 48 8b 32 mov (%rdx),%rsi
* 2a: 48 8d 7e 01 lea 0x1(%rsi),%rdi <-- trapping instruction
2e: 8b 89 14 16 00 00 mov 0x1614(%rcx),%ecx
34: 48 39 cf cmp %rcx,%rdi
37: 73 08 jae 0x41
39: 48 89 44 f2 08 mov %rax,0x8(%rdx,%rsi,8)
3e: 48 rex.W
3f: 89 .byte 0x89