============================================ WARNING: possible recursive locking detected syzkaller #0 Not tainted -------------------------------------------- syz.5.83/4762 is trying to acquire lock: ffffc900011410d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x92/0x1d0 kernel/bpf/ringbuf.c:423 but task is already holding lock: ffffc900014cd0d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x92/0x1d0 kernel/bpf/ringbuf.c:423 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 syz.5.83/4762: #0: ffffffff8319e718 (link_idr_lock){+...}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:356 [inline] #0: ffffffff8319e718 (link_idr_lock){+...}-{2:2}, at: bpf_link_free_id kernel/bpf/syscall.c:2853 [inline] #0: ffffffff8319e718 (link_idr_lock){+...}-{2:2}, at: bpf_link_free+0x22/0xe0 kernel/bpf/syscall.c:2914 #1: ffffffff83185d88 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:334 [inline] #1: ffffffff83185d88 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:786 [inline] #1: ffffffff83185d88 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2321 [inline] #1: ffffffff83185d88 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x54/0x1a0 kernel/trace/bpf_trace.c:2361 #2: ffffc900014cd0d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x92/0x1d0 kernel/bpf/ringbuf.c:423 #3: ffffffff83185d88 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:334 [inline] #3: ffffffff83185d88 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:786 [inline] #3: ffffffff83185d88 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2321 [inline] #3: ffffffff83185d88 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x54/0x1a0 kernel/trace/bpf_trace.c:2361 stack backtrace: CPU: 0 PID: 4762 Comm: syz.5.83 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Call Trace: dump_stack_lvl+0x83/0xe0 lib/dump_stack.c:106 print_deadlock_bug+0x2ac/0x2f0 kernel/locking/lockdep.c:3012 check_deadlock kernel/locking/lockdep.c:3062 [inline] validate_chain kernel/locking/lockdep.c:3856 [inline] __lock_acquire+0x1146/0x22c0 kernel/locking/lockdep.c:5137 lock_acquire+0xe9/0x260 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x60/0x90 kernel/locking/spinlock.c:162 __bpf_ringbuf_reserve+0x92/0x1d0 kernel/bpf/ringbuf.c:423 ____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:474 [inline] bpf_ringbuf_reserve+0x15/0x20 kernel/bpf/ringbuf.c:466 ___bpf_prog_run+0xe04/0x24e0 kernel/bpf/core.c:1971 __bpf_prog_run32+0xbb/0xe0 kernel/bpf/core.c:2212 bpf_dispatcher_nop_func include/linux/bpf.h:1224 [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+0xc7/0x1a0 kernel/trace/bpf_trace.c:2361 __traceiter_contention_end+0x28/0x40 include/trace/events/lock.h:122 trace_contention_end include/trace/events/lock.h:122 [inline] __pv_queued_spin_lock_slowpath+0x446/0x460 kernel/locking/qspinlock.c:560 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:586 [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+0xcf/0xe0 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x6c/0x90 kernel/locking/spinlock.c:162 __bpf_ringbuf_reserve+0x92/0x1d0 kernel/bpf/ringbuf.c:423 ____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:474 [inline] bpf_ringbuf_reserve+0x15/0x20 kernel/bpf/ringbuf.c:466 ___bpf_prog_run+0xe04/0x24e0 kernel/bpf/core.c:1971 __bpf_prog_run32+0xbb/0xe0 kernel/bpf/core.c:2212 bpf_dispatcher_nop_func include/linux/bpf.h:1224 [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+0xc7/0x1a0 kernel/trace/bpf_trace.c:2361 __traceiter_contention_end+0x28/0x40 include/trace/events/lock.h:122 trace_contention_end include/trace/events/lock.h:122 [inline] __pv_queued_spin_lock_slowpath+0x446/0x460 kernel/locking/qspinlock.c:560 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:586 [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+0xcf/0xe0 kernel/locking/spinlock_debug.c:115 spin_lock_bh include/linux/spinlock.h:356 [inline] bpf_link_free_id kernel/bpf/syscall.c:2853 [inline] bpf_link_free+0x22/0xe0 kernel/bpf/syscall.c:2914 bpf_link_put_direct kernel/bpf/syscall.c:2958 [inline] bpf_link_release+0x16/0x20 kernel/bpf/syscall.c:2965 __fput+0x87/0x290 fs/file_table.c:384 task_work_run+0x7e/0xa0 kernel/task_work.c:239 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xda/0xf0 kernel/entry/common.c:177 exit_to_user_mode_prepare+0xea/0x150 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:302 do_syscall_64+0x61/0xb0 arch/x86/entry/common.c:87 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fee6a93eec9 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:00007ffe095dd7f8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 00000000000107a0 RCX: 00007fee6a93eec9 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 00007fee6ab97da0 R08: 0000000000000001 R09: 00000004095ddaef R10: 0000001b33120000 R11: 0000000000000246 R12: 00007fee6ab95fac R13: 00007fee6ab95fa0 R14: ffffffffffffffff R15: 00007ffe095dd910