============================================
WARNING: possible recursive locking detected
6.11.0-syzkaller-11503-gc824deb1a897 #0 Not tainted
--------------------------------------------
syz.0.627/7537 is trying to acquire lock:
ffffc9000a3030d8 (&rb->spinlock){..-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1ea/0x600 kernel/bpf/ringbuf.c:427
but task is already holding lock:
ffffc9000a27f0d8 (&rb->spinlock){..-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1ea/0x600 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 syz.0.627/7537:
#0: ffffffff8e937fa0 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
#0: ffffffff8e937fa0 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2561 [inline]
#0: ffffffff8e937fa0 (rcu_callback){....}-{0:0}, at: rcu_core+0xa37/0x17a0 kernel/rcu/tree.c:2823
#1: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
#1: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
#1: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2317 [inline]
#1: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run3+0x24c/0x5a0 kernel/trace/bpf_trace.c:2360
#2: ffffc9000a27f0d8 (&rb->spinlock){..-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1ea/0x600 kernel/bpf/ringbuf.c:427
#3: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
#3: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
#3: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2317 [inline]
#3: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1fc/0x540 kernel/trace/bpf_trace.c:2359
stack backtrace:
CPU: 0 UID: 0 PID: 7537 Comm: syz.0.627 Not tainted 6.11.0-syzkaller-11503-gc824deb1a897 #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_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3034
check_deadlock kernel/locking/lockdep.c:3086 [inline]
validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3888
__lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5199
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
__bpf_ringbuf_reserve+0x1ea/0x600 kernel/bpf/ringbuf.c:427
____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:478 [inline]
bpf_ringbuf_reserve+0x5c/0x70 kernel/bpf/ringbuf.c:470
bpf_prog_fe0ed97373b08409+0x2e/0x4b
bpf_dispatcher_nop_func include/linux/bpf.h:1257 [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:2318 [inline]
bpf_trace_run2+0x2ec/0x540 kernel/trace/bpf_trace.c:2359
trace_contention_end+0x114/0x140 include/trace/events/lock.h:122
__pv_queued_spin_lock_slowpath+0xb7e/0xdb0 kernel/locking/qspinlock.c:557
pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:584 [inline]
queued_spin_lock_slowpath+0x42/0x50 arch/x86/include/asm/qspinlock.h:51
queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
do_raw_spin_lock+0x272/0x370 kernel/locking/spinlock_debug.c:116
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
_raw_spin_lock_irqsave+0xe1/0x120 kernel/locking/spinlock.c:162
__bpf_ringbuf_reserve+0x1ea/0x600 kernel/bpf/ringbuf.c:427
____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:478 [inline]
bpf_ringbuf_reserve+0x5c/0x70 kernel/bpf/ringbuf.c:470
bpf_prog_fe0ed97373b08409+0x2e/0x4b
bpf_dispatcher_nop_func include/linux/bpf.h:1257 [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:2318 [inline]
bpf_trace_run3+0x33a/0x5a0 kernel/trace/bpf_trace.c:2360
__traceiter_kmem_cache_free+0x33/0x50 include/trace/events/kmem.h:114
trace_kmem_cache_free include/trace/events/kmem.h:114 [inline]
kmem_cache_free+0x355/0x420 mm/slub.c:4681
rcu_do_batch kernel/rcu/tree.c:2567 [inline]
rcu_core+0xaaa/0x17a0 kernel/rcu/tree.c:2823
handle_softirqs+0x2c5/0x980 kernel/softirq.c:554
__do_softirq kernel/softirq.c:588 [inline]
invoke_softirq kernel/softirq.c:428 [inline]
__irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637
irq_exit_rcu+0x9/0x30 kernel/softirq.c:649
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1037 [inline]
sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1037
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:seqcount_lockdep_reader_access+0x189/0x1e0 include/linux/seqlock.h:75
Code: 42 80 3c 23 00 74 08 4c 89 ff e8 f2 84 0d 00 f6 44 24 41 02 75 50 f7 44 24 18 00 02 00 00 74 01 fb 48 c7 44 24 20 0e 36 e0 45 <4b> c7 04 34 00 00 00 00 66 43 c7 44 34 09 00 00 43 c6 44 34 0b 00
RSP: 0018:ffffc90002e7f7c0 EFLAGS: 00000206
RAX: 0f7cf4c0c573f900 RBX: 1ffff920005cff00 RCX: ffffffff9a3c5903
RDX: dffffc0000000000 RSI: ffffffff8c0aca40 RDI: ffffffff8c6100e0
RBP: ffffc90002e7f8a0 R08: ffffffff901cf8af R09: 1ffffffff2039f15
R10: dffffc0000000000 R11: fffffbfff2039f16 R12: dffffc0000000000
R13: ffff88813fffbd50 R14: 1ffff920005cfefc R15: ffffc90002e7f800
read_seqbegin include/linux/seqlock.h:757 [inline]
zone_span_seqbegin include/linux/memory_hotplug.h:103 [inline]
page_outside_zone_boundaries mm/page_alloc.c:437 [inline]
bad_range+0x5f/0x270 mm/page_alloc.c:456
rmqueue mm/page_alloc.c:3073 [inline]
get_page_from_freelist+0x302c/0x3190 mm/page_alloc.c:3454
__alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4733
__alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
bpf_ringbuf_area_alloc kernel/bpf/ringbuf.c:124 [inline]
bpf_ringbuf_alloc+0xcb/0x410 kernel/bpf/ringbuf.c:172
ringbuf_map_alloc+0x1d7/0x2f0 kernel/bpf/ringbuf.c:207
map_create+0x946/0x11c0 kernel/bpf/syscall.c:1341
__sys_bpf+0x6d1/0x810 kernel/bpf/syscall.c:5616
__do_sys_bpf kernel/bpf/syscall.c:5741 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5739 [inline]
__x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5739
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:0x7f680a97dff9
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:00007f680b74b038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f680ab35f80 RCX: 00007f680a97dff9
RDX: 0000000000000048 RSI: 00000000200000c0 RDI: 0000000000000000
RBP: 00007f680a9f0296 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f680ab35f80 R15: 00007ffe1bea7228
----------------
Code disassembly (best guess):
0: 42 80 3c 23 00 cmpb $0x0,(%rbx,%r12,1)
5: 74 08 je 0xf
7: 4c 89 ff mov %r15,%rdi
a: e8 f2 84 0d 00 call 0xd8501
f: f6 44 24 41 02 testb $0x2,0x41(%rsp)
14: 75 50 jne 0x66
16: f7 44 24 18 00 02 00 testl $0x200,0x18(%rsp)
1d: 00
1e: 74 01 je 0x21
20: fb sti
21: 48 c7 44 24 20 0e 36 movq $0x45e0360e,0x20(%rsp)
28: e0 45
* 2a: 4b c7 04 34 00 00 00 movq $0x0,(%r12,%r14,1) <-- trapping instruction
31: 00
32: 66 43 c7 44 34 09 00 movw $0x0,0x9(%r12,%r14,1)
39: 00
3a: 43 c6 44 34 0b 00 movb $0x0,0xb(%r12,%r14,1)