============================================
WARNING: possible recursive locking detected
6.6.95-syzkaller #0 Not tainted
--------------------------------------------
kworker/u4:0/11 is trying to acquire lock:
ffffc90004dc10d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1c8/0x5a0 kernel/bpf/ringbuf.c:423
but task is already holding lock:
ffffc90004e450d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1c8/0x5a0 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
6 locks held by kworker/u4:0/11:
#0: ffff88802d557538 ((wq_completion)bat_events){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2609 [inline]
#0: ffff88802d557538 ((wq_completion)bat_events){+.+.}-{0:0}, at: process_scheduled_works+0x957/0x15b0 kernel/workqueue.c:2711
#1: ffffc90000107d00 ((work_completion)(&(&bat_priv->nc.work)->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2609 [inline]
#1: ffffc90000107d00 ((work_completion)(&(&bat_priv->nc.work)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x957/0x15b0 kernel/workqueue.c:2711
#2: ffffffff8cd2f880 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:334 [inline]
#2: ffffffff8cd2f880 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2188 [inline]
#2: ffffffff8cd2f880 (rcu_callback){....}-{0:0}, at: rcu_core+0xc51/0x1720 kernel/rcu/tree.c:2467
#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_run3+0xf4/0x400 kernel/trace/bpf_trace.c:2362
#4: ffffc90004e450d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1c8/0x5a0 kernel/bpf/ringbuf.c:423
#5: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:334 [inline]
#5: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:786 [inline]
#5: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2321 [inline]
#5: ffffffff8cd2f760 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0xde/0x3c0 kernel/trace/bpf_trace.c:2361
stack backtrace:
CPU: 0 PID: 11 Comm: kworker/u4:0 Not tainted 6.6.95-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Workqueue: bat_events batadv_nc_worker
Call Trace:
dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
check_deadlock kernel/locking/lockdep.c:3062 [inline]
validate_chain kernel/locking/lockdep.c:3856 [inline]
__lock_acquire+0x5d40/0x7c80 kernel/locking/lockdep.c:5137
lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa8/0xf0 kernel/locking/spinlock.c:162
__bpf_ringbuf_reserve+0x1c8/0x5a0 kernel/bpf/ringbuf.c:423
____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:474 [inline]
bpf_ringbuf_reserve+0x5c/0x70 kernel/bpf/ringbuf.c:466
bpf_prog_fe0ed97373b08409+0x2d/0x4a
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_contention_end+0xdd/0x130 include/trace/events/lock.h:122
trace_contention_end+0xe6/0x110 include/trace/events/lock.h:122
__pv_queued_spin_lock_slowpath+0x7ec/0x9d0 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+0x24e/0x2c0 kernel/locking/spinlock_debug.c:115
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
_raw_spin_lock_irqsave+0xb4/0xf0 kernel/locking/spinlock.c:162
__bpf_ringbuf_reserve+0x1c8/0x5a0 kernel/bpf/ringbuf.c:423
____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:474 [inline]
bpf_ringbuf_reserve+0x5c/0x70 kernel/bpf/ringbuf.c:466
bpf_prog_fe0ed97373b08409+0x2d/0x4a
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_run3+0x1e7/0x400 kernel/trace/bpf_trace.c:2362
trace_kmem_cache_free include/trace/events/kmem.h:114 [inline]
kmem_cache_free+0x1e0/0x280 mm/slub.c:3837
rcu_do_batch kernel/rcu/tree.c:2194 [inline]
rcu_core+0xcc4/0x1720 kernel/rcu/tree.c:2467
handle_softirqs+0x280/0x820 kernel/softirq.c:578
__do_softirq kernel/softirq.c:612 [inline]
invoke_softirq kernel/softirq.c:452 [inline]
__irq_exit_rcu+0xc7/0x190 kernel/softirq.c:661
irq_exit_rcu+0x9/0x20 kernel/softirq.c:673
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1088 [inline]
sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1088
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:687
RIP: 0010:should_resched arch/x86/include/asm/preempt.h:104 [inline]
RIP: 0010:__local_bh_enable_ip+0x136/0x1c0 kernel/softirq.c:413
Code: 8a e8 fe ec 1c 09 65 66 8b 05 e6 38 b2 7e 66 85 c0 75 54 bf 01 00 00 00 e8 a7 e2 09 00 e8 32 78 3a 00 fb 65 8b 05 b2 38 b2 7e <85> c0 75 05 e8 91 1a af ff 48 c7 04 24 0e 36 e0 45 4b c7 04 37 00
RSP: 0018:ffffc90000107a20 EFLAGS: 00000282
RAX: 0000000080000000 RBX: 0000000000000201 RCX: def4c6fa917dbd00
RDX: dffffc0000000000 RSI: ffffffff8aaab2c0 RDI: ffffffff8afc6d40
RBP: ffffc90000107ab8 R08: ffffffff90da55ff R09: 1ffffffff21b4abf
R10: dffffc0000000000 R11: fffffbfff21b4ac0 R12: ffffffff8a371ed1
R13: dffffc0000000000 R14: dffffc0000000000 R15: 1ffff92000020f44
spin_unlock_bh include/linux/spinlock.h:396 [inline]
batadv_nc_purge_paths+0x311/0x3a0 net/batman-adv/network-coding.c:471
batadv_nc_worker+0x369/0x610 net/batman-adv/network-coding.c:722
process_one_work kernel/workqueue.c:2634 [inline]
process_scheduled_works+0xa45/0x15b0 kernel/workqueue.c:2711
worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792
kthread+0x2fa/0x390 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293
----------------
Code disassembly (best guess), 1 bytes skipped:
0: e8 fe ec 1c 09 call 0x91ced03
5: 65 66 8b 05 e6 38 b2 mov %gs:0x7eb238e6(%rip),%ax # 0x7eb238f3
c: 7e
d: 66 85 c0 test %ax,%ax
10: 75 54 jne 0x66
12: bf 01 00 00 00 mov $0x1,%edi
17: e8 a7 e2 09 00 call 0x9e2c3
1c: e8 32 78 3a 00 call 0x3a7853
21: fb sti
22: 65 8b 05 b2 38 b2 7e mov %gs:0x7eb238b2(%rip),%eax # 0x7eb238db
* 29: 85 c0 test %eax,%eax <-- trapping instruction
2b: 75 05 jne 0x32
2d: e8 91 1a af ff call 0xffaf1ac3
32: 48 c7 04 24 0e 36 e0 movq $0x45e0360e,(%rsp)
39: 45
3a: 4b rex.WXB
3b: c7 .byte 0xc7
3c: 04 37 add $0x37,%al