======================================================
WARNING: possible circular locking dependency detected
6.6.94-syzkaller #0 Not tainted
------------------------------------------------------
syz.0.82/6128 is trying to acquire lock:
ffff8880b8e295a8 (krc.lock){-.-.}-{2:2}, at: krc_this_cpu_lock kernel/rcu/tree.c:2955 [inline]
ffff8880b8e295a8 (krc.lock){-.-.}-{2:2}, at: add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3364 [inline]
ffff8880b8e295a8 (krc.lock){-.-.}-{2:2}, at: kvfree_call_rcu+0x15a/0x780 kernel/rcu/tree.c:3449
but task is already holding lock:
ffff8880b8e2b958 (hrtimer_bases.lock){-.-.}-{2:2}, at: __run_hrtimer kernel/time/hrtimer.c:1759 [inline]
ffff8880b8e2b958 (hrtimer_bases.lock){-.-.}-{2:2}, at: __hrtimer_run_queues+0x5e3/0xc40 kernel/time/hrtimer.c:1819
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (hrtimer_bases.lock){-.-.}-{2:2}:
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa8/0xf0 kernel/locking/spinlock.c:162
lock_hrtimer_base kernel/time/hrtimer.c:181 [inline]
hrtimer_start_range_ns+0xf3/0x1000 kernel/time/hrtimer.c:1354
hrtimer_start include/linux/hrtimer.h:421 [inline]
run_page_cache_worker kernel/rcu/tree.c:3346 [inline]
kvfree_call_rcu+0x5d5/0x780 kernel/rcu/tree.c:3451
rtnl_register_internal+0x486/0x590 net/core/rtnetlink.c:264
rtnl_register+0x32/0x70 net/core/rtnetlink.c:314
ip_rt_init+0x2ec/0x390 net/ipv4/route.c:3789
ip_init+0xe/0x20 net/ipv4/ip_output.c:1663
inet_init+0x2c1/0x3e0 net/ipv4/af_inet.c:2024
do_one_initcall+0x1fd/0x750 init/main.c:1238
do_initcall_level+0x137/0x1f0 init/main.c:1300
do_initcalls+0x69/0xd0 init/main.c:1316
kernel_init_freeable+0x3d2/0x570 init/main.c:1553
kernel_init+0x1d/0x1c0 init/main.c:1443
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293
-> #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 kernel/locking/lockdep.c:3869 [inline]
__lock_acquire+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137
lock_acquire+0x197/0x410 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:2955 [inline]
add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3364 [inline]
kvfree_call_rcu+0x15a/0x780 kernel/rcu/tree.c:3449
trie_delete_elem+0x535/0x6a0 kernel/bpf/lpm_trie.c:545
bpf_prog_5186c38a4019a4cb+0x4a/0x4e
bpf_dispatcher_nop_func include/linux/bpf.h:1213 [inline]
__bpf_prog_run include/linux/filter.h:612 [inline]
bpf_prog_run include/linux/filter.h:619 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2322 [inline]
bpf_trace_run2+0x1d1/0x3c0 kernel/trace/bpf_trace.c:2361
__bpf_trace_hrtimer_start+0xfb/0x150 include/trace/events/timer.h:202
trace_hrtimer_start include/trace/events/timer.h:202 [inline]
debug_activate kernel/time/hrtimer.c:506 [inline]
enqueue_hrtimer+0x318/0x370 kernel/time/hrtimer.c:1113
__run_hrtimer kernel/time/hrtimer.c:1772 [inline]
__hrtimer_run_queues+0x637/0xc40 kernel/time/hrtimer.c:1819
hrtimer_interrupt+0x3c9/0x9c0 kernel/time/hrtimer.c:1881
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1077 [inline]
__sysvec_apic_timer_interrupt+0xfb/0x3b0 arch/x86/kernel/apic/apic.c:1094
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1088 [inline]
sysvec_apic_timer_interrupt+0x9f/0xc0 arch/x86/kernel/apic/apic.c:1088
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:687
rcu_dynticks_curr_cpu_in_eqs include/linux/context_tracking.h:122 [inline]
rcu_is_watching+0x35/0xb0 kernel/rcu/tree.c:700
rcu_read_lock include/linux/rcupdate.h:787 [inline]
percpu_ref_tryget_many include/linux/percpu-refcount.h:241 [inline]
percpu_ref_tryget+0x43/0x180 include/linux/percpu-refcount.h:266
obj_cgroup_tryget include/linux/memcontrol.h:793 [inline]
__get_obj_cgroup_from_memcg+0x70/0xe0 mm/memcontrol.c:3014
get_obj_cgroup_from_current+0x16f/0x280 mm/memcontrol.c:3034
memcg_slab_pre_alloc_hook mm/slab.h:492 [inline]
slab_pre_alloc_hook+0x95/0x310 mm/slab.h:719
slab_alloc_node mm/slub.c:3467 [inline]
__kmem_cache_alloc_node+0x53/0x260 mm/slub.c:3524
__do_kmalloc_node mm/slab_common.c:1006 [inline]
__kmalloc_node+0xa4/0x230 mm/slab_common.c:1014
kmalloc_node include/linux/slab.h:620 [inline]
__bpf_map_area_alloc kernel/bpf/syscall.c:301 [inline]
bpf_map_area_alloc+0x5e/0x110 kernel/bpf/syscall.c:314
htab_map_alloc+0x77/0xe50 kernel/bpf/hashtab.c:484
map_create+0x7a5/0x1030 kernel/bpf/syscall.c:1245
__sys_bpf+0x5f0/0x800 kernel/bpf/syscall.c:5449
__do_sys_bpf kernel/bpf/syscall.c:5571 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5569 [inline]
__x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5569
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(hrtimer_bases.lock);
lock(krc.lock);
lock(hrtimer_bases.lock);
lock(krc.lock);
*** DEADLOCK ***
4 locks held by syz.0.82/6128:
#0: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:334 [inline]
#0: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:786 [inline]
#0: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: get_obj_cgroup_from_current+0xd4/0x280 mm/memcontrol.c:3029
#1: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:334 [inline]
#1: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:786 [inline]
#1: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: percpu_ref_tryget_many include/linux/percpu-refcount.h:241 [inline]
#1: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: percpu_ref_tryget+0x15/0x180 include/linux/percpu-refcount.h:266
#2: ffff8880b8e2b958 (hrtimer_bases.lock){-.-.}-{2:2}, at: __run_hrtimer kernel/time/hrtimer.c:1759 [inline]
#2: ffff8880b8e2b958 (hrtimer_bases.lock){-.-.}-{2:2}, at: __hrtimer_run_queues+0x5e3/0xc40 kernel/time/hrtimer.c:1819
#3: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:334 [inline]
#3: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:786 [inline]
#3: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2321 [inline]
#3: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0xde/0x3c0 kernel/trace/bpf_trace.c:2361
stack backtrace:
CPU: 0 PID: 6128 Comm: syz.0.82 Not tainted 6.6.94-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
check_noncircular+0x2bd/0x3c0 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 kernel/locking/lockdep.c:3869 [inline]
__lock_acquire+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137
lock_acquire+0x197/0x410 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:2955 [inline]
add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3364 [inline]
kvfree_call_rcu+0x15a/0x780 kernel/rcu/tree.c:3449
trie_delete_elem+0x535/0x6a0 kernel/bpf/lpm_trie.c:545
bpf_prog_5186c38a4019a4cb+0x4a/0x4e
bpf_dispatcher_nop_func include/linux/bpf.h:1213 [inline]
__bpf_prog_run include/linux/filter.h:612 [inline]
bpf_prog_run include/linux/filter.h:619 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2322 [inline]
bpf_trace_run2+0x1d1/0x3c0 kernel/trace/bpf_trace.c:2361
__bpf_trace_hrtimer_start+0xfb/0x150 include/trace/events/timer.h:202
trace_hrtimer_start include/trace/events/timer.h:202 [inline]
debug_activate kernel/time/hrtimer.c:506 [inline]
enqueue_hrtimer+0x318/0x370 kernel/time/hrtimer.c:1113
__run_hrtimer kernel/time/hrtimer.c:1772 [inline]
__hrtimer_run_queues+0x637/0xc40 kernel/time/hrtimer.c:1819
hrtimer_interrupt+0x3c9/0x9c0 kernel/time/hrtimer.c:1881
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1077 [inline]
__sysvec_apic_timer_interrupt+0xfb/0x3b0 arch/x86/kernel/apic/apic.c:1094
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1088 [inline]
sysvec_apic_timer_interrupt+0x9f/0xc0 arch/x86/kernel/apic/apic.c:1088
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:687
RIP: 0010:rcu_dynticks_curr_cpu_in_eqs include/linux/context_tracking.h:122 [inline]
RIP: 0010:rcu_is_watching+0x35/0xb0 kernel/rcu/tree.c:700
Code: 05 98 29 94 7e e8 eb bb f6 08 89 c3 83 f8 08 73 60 49 bf 00 00 00 00 00 fc ff df 4c 8d 34 dd 30 da 7b 8c 4c 89 f0 48 c1 e8 03 <42> 80 3c 38 00 74 08 4c 89 f7 e8 4c ac 6e 00 48 c7 c3 48 6d 03 00
RSP: 0018:ffffc9000b63fae8 EFLAGS: 00000a02
RAX: 1ffffffff18f7b46 RBX: 0000000000000000 RCX: f5e70e59c9895e00
RDX: 0000000000000000 RSI: ffffffff8afc68e0 RDI: ffffffff8afc68a0
RBP: 0000000000512dc0 R08: dffffc0000000000 R09: 1ffffffff21b0aa4
R10: dffffc0000000000 R11: fffffbfff21b0aa5 R12: 0000000000000000
R13: 00000000ffffffff R14: ffffffff8c7bda30 R15: dffffc0000000000
rcu_read_lock include/linux/rcupdate.h:787 [inline]
percpu_ref_tryget_many include/linux/percpu-refcount.h:241 [inline]
percpu_ref_tryget+0x43/0x180 include/linux/percpu-refcount.h:266
obj_cgroup_tryget include/linux/memcontrol.h:793 [inline]
__get_obj_cgroup_from_memcg+0x70/0xe0 mm/memcontrol.c:3014
get_obj_cgroup_from_current+0x16f/0x280 mm/memcontrol.c:3034
memcg_slab_pre_alloc_hook mm/slab.h:492 [inline]
slab_pre_alloc_hook+0x95/0x310 mm/slab.h:719
slab_alloc_node mm/slub.c:3467 [inline]
__kmem_cache_alloc_node+0x53/0x260 mm/slub.c:3524
__do_kmalloc_node mm/slab_common.c:1006 [inline]
__kmalloc_node+0xa4/0x230 mm/slab_common.c:1014
kmalloc_node include/linux/slab.h:620 [inline]
__bpf_map_area_alloc kernel/bpf/syscall.c:301 [inline]
bpf_map_area_alloc+0x5e/0x110 kernel/bpf/syscall.c:314
htab_map_alloc+0x77/0xe50 kernel/bpf/hashtab.c:484
map_create+0x7a5/0x1030 kernel/bpf/syscall.c:1245
__sys_bpf+0x5f0/0x800 kernel/bpf/syscall.c:5449
__do_sys_bpf kernel/bpf/syscall.c:5571 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5569 [inline]
__x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5569
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f761118e929
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:00007f7612070038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f76113b5fa0 RCX: 00007f761118e929
RDX: 0000000000000050 RSI: 0000200000000580 RDI: 0000000000000000
RBP: 00007f7611210b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f76113b5fa0 R15: 00007ffc0c858ee8
----------------
Code disassembly (best guess):
0: 05 98 29 94 7e add $0x7e942998,%eax
5: e8 eb bb f6 08 call 0x8f6bbf5
a: 89 c3 mov %eax,%ebx
c: 83 f8 08 cmp $0x8,%eax
f: 73 60 jae 0x71
11: 49 bf 00 00 00 00 00 movabs $0xdffffc0000000000,%r15
18: fc ff df
1b: 4c 8d 34 dd 30 da 7b lea -0x738425d0(,%rbx,8),%r14
22: 8c
23: 4c 89 f0 mov %r14,%rax
26: 48 c1 e8 03 shr $0x3,%rax
* 2a: 42 80 3c 38 00 cmpb $0x0,(%rax,%r15,1) <-- trapping instruction
2f: 74 08 je 0x39
31: 4c 89 f7 mov %r14,%rdi
34: e8 4c ac 6e 00 call 0x6eac85
39: 48 c7 c3 48 6d 03 00 mov $0x36d48,%rbx