======================================================
WARNING: possible circular locking dependency detected
6.12.0-rc4-syzkaller-g77017b9c4682 #0 Not tainted
------------------------------------------------------
syz.6.1020/9903 is trying to acquire lock:
ffff8880b8629430 (krc.lock){-.-.}-{2:2}, at: krc_this_cpu_lock kernel/rcu/tree.c:3312 [inline]
ffff8880b8629430 (krc.lock){-.-.}-{2:2}, at: add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3725 [inline]
ffff8880b8629430 (krc.lock){-.-.}-{2:2}, at: kvfree_call_rcu+0x18a/0x790 kernel/rcu/tree.c:3811
but task is already holding lock:
ffff8880b862c898 (hrtimer_bases.lock){-.-.}-{2:2}, at: __run_hrtimer kernel/time/hrtimer.c:1695 [inline]
ffff8880b862c898 (hrtimer_bases.lock){-.-.}-{2:2}, at: __hrtimer_run_queues+0x670/0xd50 kernel/time/hrtimer.c:1755
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (hrtimer_bases.lock){-.-.}-{2:2}:
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
lock_hrtimer_base kernel/time/hrtimer.c:175 [inline]
hrtimer_start_range_ns+0x109/0xca0 kernel/time/hrtimer.c:1300
hrtimer_start include/linux/hrtimer.h:275 [inline]
run_page_cache_worker kernel/rcu/tree.c:3707 [inline]
kvfree_call_rcu+0x5e6/0x790 kernel/rcu/tree.c:3813
pwq_release_workfn+0x664/0x800 kernel/workqueue.c:5078
kthread_worker_fn+0x500/0xb70 kernel/kthread.c:844
kthread+0x2f0/0x390 kernel/kthread.c:389
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:3161 [inline]
check_prevs_add kernel/locking/lockdep.c:3280 [inline]
validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904
__lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
__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:3312 [inline]
add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3725 [inline]
kvfree_call_rcu+0x18a/0x790 kernel/rcu/tree.c:3811
trie_delete_elem+0x546/0x6a0 kernel/bpf/lpm_trie.c:540
bpf_prog_2c29ac5cdc6b1842+0x43/0x47
bpf_dispatcher_nop_func include/linux/bpf.h:1290 [inline]
__bpf_prog_run include/linux/filter.h:701 [inline]
bpf_prog_run include/linux/filter.h:708 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2340 [inline]
bpf_trace_run2+0x2ec/0x540 kernel/trace/bpf_trace.c:2381
trace_hrtimer_start include/trace/events/timer.h:222 [inline]
debug_activate kernel/time/hrtimer.c:479 [inline]
enqueue_hrtimer+0x35a/0x3c0 kernel/time/hrtimer.c:1085
__run_hrtimer kernel/time/hrtimer.c:1708 [inline]
__hrtimer_run_queues+0x6cb/0xd50 kernel/time/hrtimer.c:1755
hrtimer_interrupt+0x396/0x990 kernel/time/hrtimer.c:1817
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1038 [inline]
__sysvec_apic_timer_interrupt+0x110/0x420 arch/x86/kernel/apic/apic.c:1055
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline]
sysvec_apic_timer_interrupt+0xa1/0xc0 arch/x86/kernel/apic/apic.c:1049
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
__text_poke+0xa4a/0xd30
text_poke arch/x86/kernel/alternative.c:1984 [inline]
text_poke_bp_batch+0x265/0xb30 arch/x86/kernel/alternative.c:2292
text_poke_flush arch/x86/kernel/alternative.c:2486 [inline]
text_poke_finish+0x30/0x50 arch/x86/kernel/alternative.c:2493
arch_jump_label_transform_apply+0x1c/0x30 arch/x86/kernel/jump_label.c:146
static_key_enable_cpuslocked+0x136/0x260 kernel/jump_label.c:210
static_key_enable+0x1a/0x20 kernel/jump_label.c:223
tracepoint_add_func+0x953/0x9e0 kernel/tracepoint.c:361
tracepoint_probe_register_prio_may_exist+0x122/0x190 kernel/tracepoint.c:482
bpf_raw_tp_link_attach+0x48b/0x6e0 kernel/bpf/syscall.c:3950
bpf_raw_tracepoint_open+0x177/0x1f0 kernel/bpf/syscall.c:3981
__sys_bpf+0x3c0/0x810 kernel/bpf/syscall.c:5796
__do_sys_bpf kernel/bpf/syscall.c:5861 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5859 [inline]
__x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5859
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
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 ***
8 locks held by syz.6.1020/9903:
#0: ffffffff8e98a548 (tracepoints_mutex){+.+.}-{3:3}, at: tracepoint_probe_register_prio_may_exist+0xbb/0x190 kernel/tracepoint.c:478
#1: ffffffff8e7d1e10 (cpu_hotplug_lock){++++}-{0:0}, at: static_key_enable+0x12/0x20 kernel/jump_label.c:222
#2: ffffffff8e9ed7c8 (jump_label_mutex){+.+.}-{3:3}, at: jump_label_lock kernel/jump_label.c:27 [inline]
#2: ffffffff8e9ed7c8 (jump_label_mutex){+.+.}-{3:3}, at: static_key_enable_cpuslocked+0xd7/0x260 kernel/jump_label.c:207
#3: ffffffff8e7e6fc8 (text_mutex){+.+.}-{3:3}, at: arch_jump_label_transform_apply+0x17/0x30 arch/x86/kernel/jump_label.c:145
#4: ffffffff8e937e20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
#4: ffffffff8e937e20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
#4: ffffffff8e937e20 (rcu_read_lock){....}-{1:2}, at: __pte_offset_map+0x82/0x380 mm/pgtable-generic.c:287
#5: ffff88801ac7b078 (ptlock_ptr(ptdesc)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
#5: ffff88801ac7b078 (ptlock_ptr(ptdesc)#2){+.+.}-{2:2}, at: __pte_offset_map_lock+0x1ba/0x300 mm/pgtable-generic.c:375
#6: ffff8880b862c898 (hrtimer_bases.lock){-.-.}-{2:2}, at: __run_hrtimer kernel/time/hrtimer.c:1695 [inline]
#6: ffff8880b862c898 (hrtimer_bases.lock){-.-.}-{2:2}, at: __hrtimer_run_queues+0x670/0xd50 kernel/time/hrtimer.c:1755
#7: ffffffff8e937e20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
#7: ffffffff8e937e20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
#7: ffffffff8e937e20 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2339 [inline]
#7: ffffffff8e937e20 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1fc/0x540 kernel/trace/bpf_trace.c:2381
stack backtrace:
CPU: 0 UID: 0 PID: 9903 Comm: syz.6.1020 Not tainted 6.12.0-rc4-syzkaller-g77017b9c4682 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2074
check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2206
check_prev_add kernel/locking/lockdep.c:3161 [inline]
check_prevs_add kernel/locking/lockdep.c:3280 [inline]
validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904
__lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
__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:3312 [inline]
add_ptr_to_bulk_krc_lock kernel/rcu/tree.c:3725 [inline]
kvfree_call_rcu+0x18a/0x790 kernel/rcu/tree.c:3811
trie_delete_elem+0x546/0x6a0 kernel/bpf/lpm_trie.c:540
bpf_prog_2c29ac5cdc6b1842+0x43/0x47
bpf_dispatcher_nop_func include/linux/bpf.h:1290 [inline]
__bpf_prog_run include/linux/filter.h:701 [inline]
bpf_prog_run include/linux/filter.h:708 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2340 [inline]
bpf_trace_run2+0x2ec/0x540 kernel/trace/bpf_trace.c:2381
trace_hrtimer_start include/trace/events/timer.h:222 [inline]
debug_activate kernel/time/hrtimer.c:479 [inline]
enqueue_hrtimer+0x35a/0x3c0 kernel/time/hrtimer.c:1085
__run_hrtimer kernel/time/hrtimer.c:1708 [inline]
__hrtimer_run_queues+0x6cb/0xd50 kernel/time/hrtimer.c:1755
hrtimer_interrupt+0x396/0x990 kernel/time/hrtimer.c:1817
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1038 [inline]
__sysvec_apic_timer_interrupt+0x110/0x420 arch/x86/kernel/apic/apic.c:1055
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline]
sysvec_apic_timer_interrupt+0xa1/0xc0 arch/x86/kernel/apic/apic.c:1049
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:__text_poke+0xa4a/0xd30 arch/x86/kernel/alternative.c:1960
Code: 7c 24 50 00 75 19 e8 15 6d 5f 00 eb 18 e8 0e 6d 5f 00 e8 d9 8c 91 0a 48 83 7c 24 50 00 74 e7 e8 fc 6c 5f 00 fb 48 8b 44 24 78 <42> 80 3c 28 00 74 0d 48 8d bc 24 60 01 00 00 e8 c2 42 c9 00 48 8b
RSP: 0018:ffffc900044476a0 EFLAGS: 00000293
RAX: 1ffff92000888f00 RBX: 0000000000000000 RCX: ffff888027e35a00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90004447870 R08: ffffffff81356a94 R09: 1ffffffff2859500
R10: dffffc0000000000 R11: fffffbfff2859501 R12: 1ffff92000888ee4
R13: dffffc0000000000 R14: 0000000000000046 R15: ffffffff81826030
text_poke arch/x86/kernel/alternative.c:1984 [inline]
text_poke_bp_batch+0x265/0xb30 arch/x86/kernel/alternative.c:2292
text_poke_flush arch/x86/kernel/alternative.c:2486 [inline]
text_poke_finish+0x30/0x50 arch/x86/kernel/alternative.c:2493
arch_jump_label_transform_apply+0x1c/0x30 arch/x86/kernel/jump_label.c:146
static_key_enable_cpuslocked+0x136/0x260 kernel/jump_label.c:210
static_key_enable+0x1a/0x20 kernel/jump_label.c:223
tracepoint_add_func+0x953/0x9e0 kernel/tracepoint.c:361
tracepoint_probe_register_prio_may_exist+0x122/0x190 kernel/tracepoint.c:482
bpf_raw_tp_link_attach+0x48b/0x6e0 kernel/bpf/syscall.c:3950
bpf_raw_tracepoint_open+0x177/0x1f0 kernel/bpf/syscall.c:3981
__sys_bpf+0x3c0/0x810 kernel/bpf/syscall.c:5796
__do_sys_bpf kernel/bpf/syscall.c:5861 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5859 [inline]
__x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5859
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f567857e719
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:00007f567938a038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f5678735f80 RCX: 00007f567857e719
RDX: 000000000000003d RSI: 0000000020000000 RDI: 0000000000000011
RBP: 00007f56785f132e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f5678735f80 R15: 00007ffcc7298848
----------------
Code disassembly (best guess):
0: 7c 24 jl 0x26
2: 50 push %rax
3: 00 75 19 add %dh,0x19(%rbp)
6: e8 15 6d 5f 00 call 0x5f6d20
b: eb 18 jmp 0x25
d: e8 0e 6d 5f 00 call 0x5f6d20
12: e8 d9 8c 91 0a call 0xa918cf0
17: 48 83 7c 24 50 00 cmpq $0x0,0x50(%rsp)
1d: 74 e7 je 0x6
1f: e8 fc 6c 5f 00 call 0x5f6d20
24: fb sti
25: 48 8b 44 24 78 mov 0x78(%rsp),%rax
* 2a: 42 80 3c 28 00 cmpb $0x0,(%rax,%r13,1) <-- trapping instruction
2f: 74 0d je 0x3e
31: 48 8d bc 24 60 01 00 lea 0x160(%rsp),%rdi
38: 00
39: e8 c2 42 c9 00 call 0xc94300
3e: 48 rex.W
3f: 8b .byte 0x8b