============================================
WARNING: possible recursive locking detected
6.12.0-syzkaller-08446-g228a1157fb9f #0 Not tainted
--------------------------------------------
kworker/3:0/35 is trying to acquire lock:
ffffc90005a690d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x36e/0x4b0 kernel/bpf/ringbuf.c:427
but task is already holding lock:
ffffc90005e510d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x36e/0x4b0 kernel/bpf/ringbuf.c:427
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&rb->spinlock);
lock(&rb->spinlock);
*** DEADLOCK ***
May be due to missing lock nesting notation
4 locks held by kworker/3:0/35:
#0: ffffffff8e1bb9a0 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
#0: ffffffff8e1bb9a0 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2561 [inline]
#0: ffffffff8e1bb9a0 (rcu_callback){....}-{0:0}, at: rcu_core+0x741/0x14d0 kernel/rcu/tree.c:2823
#1: ffffffff8e1bbac0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
#1: ffffffff8e1bbac0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
#1: ffffffff8e1bbac0 (rcu_read_lock){....}-{1:3}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2350 [inline]
#1: ffffffff8e1bbac0 (rcu_read_lock){....}-{1:3}, at: bpf_trace_run2+0x1c2/0x590 kernel/trace/bpf_trace.c:2392
#2: ffffc90005e510d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x36e/0x4b0 kernel/bpf/ringbuf.c:427
#3: ffffffff8e1bbac0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
#3: ffffffff8e1bbac0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
#3: ffffffff8e1bbac0 (rcu_read_lock){....}-{1:3}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2350 [inline]
#3: ffffffff8e1bbac0 (rcu_read_lock){....}-{1:3}, at: bpf_trace_run2+0x1c2/0x590 kernel/trace/bpf_trace.c:2392
stack backtrace:
CPU: 3 UID: 0 PID: 35 Comm: kworker/3:0 Not tainted 6.12.0-syzkaller-08446-g228a1157fb9f #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Workqueue: 0x0 (events)
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
print_deadlock_bug+0x2e3/0x410 kernel/locking/lockdep.c:3037
check_deadlock kernel/locking/lockdep.c:3089 [inline]
validate_chain kernel/locking/lockdep.c:3891 [inline]
__lock_acquire+0x2117/0x3c40 kernel/locking/lockdep.c:5226
lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
__bpf_ringbuf_reserve+0x36e/0x4b0 kernel/bpf/ringbuf.c:427
____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:478 [inline]
bpf_ringbuf_reserve+0x57/0x90 kernel/bpf/ringbuf.c:470
bpf_prog_0e153dac479590bf+0x35/0x70
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:2351 [inline]
bpf_trace_run2+0x231/0x590 kernel/trace/bpf_trace.c:2392
__bpf_trace_contention_begin+0xca/0x110 include/trace/events/lock.h:95
__preempt_count_dec_and_test arch/x86/include/asm/preempt.h:94 [inline]
trace_contention_begin.constprop.0+0xeb/0x170 include/trace/events/lock.h:95
__pv_queued_spin_lock_slowpath+0x10b/0xc90 kernel/locking/qspinlock.c:402
pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:584 [inline]
queued_spin_lock_slowpath arch/x86/include/asm/qspinlock.h:51 [inline]
queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
do_raw_spin_lock+0x210/0x2c0 kernel/locking/spinlock_debug.c:116
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
_raw_spin_lock_irqsave+0x42/0x60 kernel/locking/spinlock.c:162
__bpf_ringbuf_reserve+0x36e/0x4b0 kernel/bpf/ringbuf.c:427
____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:478 [inline]
bpf_ringbuf_reserve+0x57/0x90 kernel/bpf/ringbuf.c:470
bpf_prog_0a356b655cdd954f+0x31/0x4b
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:2351 [inline]
bpf_trace_run2+0x231/0x590 kernel/trace/bpf_trace.c:2392
trace_kfree include/trace/events/kmem.h:94 [inline]
kfree+0x258/0x4b0 mm/slub.c:4714
kfree_const+0x55/0x60 mm/util.c:43
kernfs_free_rcu+0x49/0x150 fs/kernfs/dir.c:536
rcu_do_batch kernel/rcu/tree.c:2567 [inline]
rcu_core+0x79d/0x14d0 kernel/rcu/tree.c:2823
handle_softirqs+0x213/0x8f0 kernel/softirq.c:554
__do_softirq kernel/softirq.c:588 [inline]
invoke_softirq kernel/softirq.c:428 [inline]
__irq_exit_rcu+0x109/0x170 kernel/softirq.c:655
irq_exit_rcu+0x9/0x30 kernel/softirq.c:671
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline]
sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1049
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:finish_task_switch.isra.0+0x220/0xcc0 kernel/sched/core.c:5243
Code: a9 0a 00 00 44 8b 0d f3 66 02 0f 45 85 c9 0f 85 c0 01 00 00 48 89 df e8 ae f8 ff ff e8 59 da 38 00 fb 65 48 8b 1d a0 c9 a6 7e <48> 8d bb f8 15 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1
RSP: 0018:ffffc900008efc00 EFLAGS: 00000206
RAX: 00000000000176f5 RBX: ffff88801ee90000 RCX: 1ffffffff20be001
RDX: 0000000000000000 RSI: ffffffff8b6cdd60 RDI: ffffffff8bd0e340
RBP: ffffc900008efc48 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff905f4257 R11: 0000000000000000 R12: ffff88806a93f920
R13: ffff888026462440 R14: 0000000000000000 R15: ffff88806a93eb00
context_switch kernel/sched/core.c:5372 [inline]
__schedule+0xe60/0x5ad0 kernel/sched/core.c:6756
__schedule_loop kernel/sched/core.c:6833 [inline]
schedule+0xe7/0x350 kernel/sched/core.c:6848
worker_thread+0x2de/0xf00 kernel/workqueue.c:3406
kthread+0x2c1/0x3a0 kernel/kthread.c:389
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
----------------
Code disassembly (best guess):
0: a9 0a 00 00 44 test $0x4400000a,%eax
5: 8b 0d f3 66 02 0f mov 0xf0266f3(%rip),%ecx # 0xf0266fe
b: 45 85 c9 test %r9d,%r9d
e: 0f 85 c0 01 00 00 jne 0x1d4
14: 48 89 df mov %rbx,%rdi
17: e8 ae f8 ff ff call 0xfffff8ca
1c: e8 59 da 38 00 call 0x38da7a
21: fb sti
22: 65 48 8b 1d a0 c9 a6 mov %gs:0x7ea6c9a0(%rip),%rbx # 0x7ea6c9ca
29: 7e
* 2a: 48 8d bb f8 15 00 00 lea 0x15f8(%rbx),%rdi <-- trapping instruction
31: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
38: fc ff df
3b: 48 89 fa mov %rdi,%rdx
3e: 48 rex.W
3f: c1 .byte 0xc1