============================================
WARNING: possible recursive locking detected
6.11.0-rc4-syzkaller-00280-g8a3f14bb1e94 #0 Not tainted
--------------------------------------------
syz-executor260/5249 is trying to acquire lock:
ffffc90003b810d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1ea/0x600 kernel/bpf/ringbuf.c:427
but task is already holding lock:
ffffc900038e90d8 (&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
9 locks held by syz-executor260/5249:
#0: ffff888074f70a90 (&vma->vm_lock->lock){++++}-{3:3}, at: vma_start_read include/linux/mm.h:690 [inline]
#0: ffff888074f70a90 (&vma->vm_lock->lock){++++}-{3:3}, at: lock_vma_under_rcu+0x2f9/0x6e0 mm/memory.c:5998
#1: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:326 [inline]
#1: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:838 [inline]
#1: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: do_fault_around mm/memory.c:5018 [inline]
#1: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: do_read_fault mm/memory.c:5052 [inline]
#1: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: do_fault mm/memory.c:5191 [inline]
#1: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: do_pte_missing mm/memory.c:3947 [inline]
#1: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: handle_pte_fault+0x2207/0x6fc0 mm/memory.c:5521
#2: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:326 [inline]
#2: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:838 [inline]
#2: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: filemap_map_pages+0x24f/0x1e70 mm/filemap.c:3615
#3: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:326 [inline]
#3: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:838 [inline]
#3: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: __pte_offset_map+0x82/0x380 mm/pgtable-generic.c:287
#4: ffff888078f05c18 (ptlock_ptr(ptdesc)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
#4: ffff888078f05c18 (ptlock_ptr(ptdesc)#2){+.+.}-{2:2}, at: __pte_offset_map_lock+0x1ba/0x300 mm/pgtable-generic.c:375
#5: ffffffff8e9383e0 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:326 [inline]
#5: ffffffff8e9383e0 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2563 [inline]
#5: ffffffff8e9383e0 (rcu_callback){....}-{0:0}, at: rcu_core+0xa86/0x1830 kernel/rcu/tree.c:2843
#6: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:326 [inline]
#6: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:838 [inline]
#6: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2314 [inline]
#6: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1fc/0x540 kernel/trace/bpf_trace.c:2356
#7: ffffc900038e90d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1ea/0x600 kernel/bpf/ringbuf.c:427
#8: ffffffff8e938320 (rcu_read_lock){....}-{1:2}, at: trace_call_bpf+0xbc/0x8a0
stack backtrace:
CPU: 0 UID: 0 PID: 5249 Comm: syz-executor260 Not tainted 6.11.0-rc4-syzkaller-00280-g8a3f14bb1e94 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119
check_deadlock kernel/locking/lockdep.c:3061 [inline]
validate_chain+0x15d3/0x5900 kernel/locking/lockdep.c:3855
__lock_acquire+0x137a/0x2040 kernel/locking/lockdep.c:5142
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5759
__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_output kernel/bpf/ringbuf.c:553 [inline]
bpf_ringbuf_output+0x67/0x1e0 kernel/bpf/ringbuf.c:543
bpf_prog_4aaef4562453526c+0x43/0x47
bpf_dispatcher_nop_func include/linux/bpf.h:1254 [inline]
__bpf_prog_run include/linux/filter.h:701 [inline]
bpf_prog_run include/linux/filter.h:708 [inline]
bpf_prog_run_array include/linux/bpf.h:2120 [inline]
trace_call_bpf+0x369/0x8a0 kernel/trace/bpf_trace.c:146
perf_trace_run_bpf_submit+0x82/0x180 kernel/events/core.c:10304
perf_trace_lock_acquire+0x3c3/0x4f0 include/trace/events/lock.h:24
trace_lock_acquire include/trace/events/lock.h:24 [inline]
lock_acquire+0x51b/0x550 kernel/locking/lockdep.c:5730
rcu_lock_acquire include/linux/rcupdate.h:326 [inline]
rcu_read_lock include/linux/rcupdate.h:838 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2314 [inline]
bpf_trace_run2+0x219/0x540 kernel/trace/bpf_trace.c:2356
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_f42551b0fba4abb2+0x2e/0x48
bpf_dispatcher_nop_func include/linux/bpf.h:1254 [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:2315 [inline]
bpf_trace_run2+0x2ec/0x540 kernel/trace/bpf_trace.c:2356
__traceiter_kfree+0x2b/0x50 include/trace/events/kmem.h:94
trace_kfree include/trace/events/kmem.h:94 [inline]
kfree+0x2bb/0x360 mm/slub.c:4581
rcu_do_batch kernel/rcu/tree.c:2569 [inline]
rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2843
handle_softirqs+0x2c4/0x970 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:1043 [inline]
sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:bytes_is_nonzero mm/kasan/generic.c:89 [inline]
RIP: 0010:memory_is_nonzero mm/kasan/generic.c:104 [inline]
RIP: 0010:memory_is_poisoned_n mm/kasan/generic.c:129 [inline]
RIP: 0010:memory_is_poisoned mm/kasan/generic.c:161 [inline]
RIP: 0010:check_region_inline mm/kasan/generic.c:180 [inline]
RIP: 0010:kasan_check_range+0x8c/0x290 mm/kasan/generic.c:189
Code: 3c 31 4c 89 fd 4c 29 dd 48 83 fd 10 7f 29 48 85 ed 0f 84 3e 01 00 00 4c 89 cd 48 f7 d5 48 01 dd 41 80 3b 00 0f 85 c9 01 00 00 <49> ff c3 48 ff c5 75 ee e9 1e 01 00 00 45 89 dc 41 83 e4 07 0f 84
RSP: 0000:ffffc90003357228 EFLAGS: 00000246
RAX: 0000000000000001 RBX: 1ffffffff1817dcc RCX: ffffffff816ed3a4
RDX: 0000000000000000 RSI: 0000000000000013 RDI: ffffffff8c0bee60
RBP: fffffffffffffffe R08: ffffffff8c0bee72 R09: 1ffffffff1817dce
R10: dffffc0000000000 R11: fffffbfff1817dcd R12: 0000000000000013
R13: ffffe8ffffc19090 R14: dffffc0000000001 R15: fffffbfff1817dcf
__asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105
perf_trace_lock_acquire+0x324/0x4f0 include/trace/events/lock.h:24
trace_lock_acquire include/trace/events/lock.h:24 [inline]
lock_acquire+0x51b/0x550 kernel/locking/lockdep.c:5730
rcu_lock_acquire include/linux/rcupdate.h:326 [inline]
rcu_read_lock_sched include/linux/rcupdate.h:930 [inline]
pfn_valid+0x113/0x450 include/linux/mmzone.h:2022
page_table_check_set+0x25/0x550 mm/page_table_check.c:110
__page_table_check_ptes_set+0x30f/0x410 mm/page_table_check.c:225
page_table_check_ptes_set include/linux/page_table_check.h:74 [inline]
set_ptes include/linux/pgtable.h:267 [inline]
set_pte_range+0x724/0x750 mm/memory.c:4806
filemap_map_order0_folio mm/filemap.c:3594 [inline]
filemap_map_pages+0x117b/0x1e70 mm/filemap.c:3644
do_fault_around mm/memory.c:5019 [inline]
do_read_fault mm/memory.c:5052 [inline]
do_fault mm/memory.c:5191 [inline]
do_pte_missing mm/memory.c:3947 [inline]
handle_pte_fault+0x309e/0x6fc0 mm/memory.c:5521
__handle_mm_fault mm/memory.c:5664 [inline]
handle_mm_fault+0x1109/0x1bc0 mm/memory.c:5832
do_user_addr_fault arch/x86/mm/fault.c:1338 [inline]
handle_page_fault arch/x86/mm/fault.c:1481 [inline]
exc_page_fault+0x459/0x8c0 arch/x86/mm/fault.c:1539
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0033:0x7f3beb8f27c0
Code: 8b 03 48 89 05 09 69 07 00 48 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 <48> 83 ec 58 49 89 ca 48 89 74 24 28 48 89 54 24 30 48 89 4c 24 38
RSP: 002b:00007ffc7a0e3c38 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 0000000000000001
RBP: 0000000000000000 R08: 0000000000000000 R09: 00007f3beb96faa0
R10: 0000555585c24380 R11: 00007f3beb96faa0 R12: 000000000000f06c
R13: 00007ffc7a0e3c4c R14: 00007ffc7a0e3c60 R15: 00007ffc7a0e3c50
----------------
Code disassembly (best guess):
0: 3c 31 cmp $0x31,%al
2: 4c 89 fd mov %r15,%rbp
5: 4c 29 dd sub %r11,%rbp
8: 48 83 fd 10 cmp $0x10,%rbp
c: 7f 29 jg 0x37
e: 48 85 ed test %rbp,%rbp
11: 0f 84 3e 01 00 00 je 0x155
17: 4c 89 cd mov %r9,%rbp
1a: 48 f7 d5 not %rbp
1d: 48 01 dd add %rbx,%rbp
20: 41 80 3b 00 cmpb $0x0,(%r11)
24: 0f 85 c9 01 00 00 jne 0x1f3
* 2a: 49 ff c3 inc %r11 <-- trapping instruction
2d: 48 ff c5 inc %rbp
30: 75 ee jne 0x20
32: e9 1e 01 00 00 jmp 0x155
37: 45 89 dc mov %r11d,%r12d
3a: 41 83 e4 07 and $0x7,%r12d
3e: 0f .byte 0xf
3f: 84 .byte 0x84