============================================
WARNING: possible recursive locking detected
6.9.0-syzkaller-12162-gf85af9d955ac #0 Not tainted
--------------------------------------------
syz-executor.3/6168 is trying to acquire lock:
ffff88802c1ad1d8 (&qs->lock){..-.}-{2:2}, at: __queue_map_get+0x14b/0x4d0 kernel/bpf/queue_stack_maps.c:105
but task is already holding lock:
ffff88802c1ad1d8 (&qs->lock){..-.}-{2:2}, at: queue_stack_map_push_elem+0x1b2/0x660 kernel/bpf/queue_stack_maps.c:210
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&qs->lock);
lock(&qs->lock);
*** DEADLOCK ***
May be due to missing lock nesting notation
9 locks held by syz-executor.3/6168:
#0: ffffffff8e3dfc10 (dup_mmap_sem){.+.+}-{0:0}, at: dup_mmap kernel/fork.c:637 [inline]
#0: ffffffff8e3dfc10 (dup_mmap_sem){.+.+}-{0:0}, at: dup_mm kernel/fork.c:1688 [inline]
#0: ffffffff8e3dfc10 (dup_mmap_sem){.+.+}-{0:0}, at: copy_mm+0x274/0x2020 kernel/fork.c:1737
#1: ffff88801dd4c418 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:122 [inline]
#1: ffff88801dd4c418 (&mm->mmap_lock){++++}-{3:3}, at: dup_mmap kernel/fork.c:638 [inline]
#1: ffff88801dd4c418 (&mm->mmap_lock){++++}-{3:3}, at: dup_mm kernel/fork.c:1688 [inline]
#1: ffff88801dd4c418 (&mm->mmap_lock){++++}-{3:3}, at: copy_mm+0x29c/0x2020 kernel/fork.c:1737
#2: ffff88807f44f398 (&mm->mmap_lock/1){+.+.}-{3:3}, at: mmap_write_lock_nested include/linux/mmap_lock.h:113 [inline]
#2: ffff88807f44f398 (&mm->mmap_lock/1){+.+.}-{3:3}, at: dup_mmap kernel/fork.c:647 [inline]
#2: ffff88807f44f398 (&mm->mmap_lock/1){+.+.}-{3:3}, at: dup_mm kernel/fork.c:1688 [inline]
#2: ffff88807f44f398 (&mm->mmap_lock/1){+.+.}-{3:3}, at: copy_mm+0x3e0/0x2020 kernel/fork.c:1737
#3: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
#3: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
#3: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: __pte_offset_map+0x82/0x380 mm/pgtable-generic.c:287
#4: ffff88807c3326d8 (ptlock_ptr(ptdesc)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline]
#4: ffff88807c3326d8 (ptlock_ptr(ptdesc)#2){+.+.}-{2:2}, at: __pte_offset_map_lock+0x1ba/0x300 mm/pgtable-generic.c:375
#5: ffffffff8e333f20 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
#5: ffffffff8e333f20 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2529 [inline]
#5: ffffffff8e333f20 (rcu_callback){....}-{0:0}, at: rcu_core+0xa86/0x1830 kernel/rcu/tree.c:2809
#6: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
#6: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
#6: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2402 [inline]
#6: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run3+0x24c/0x5a0 kernel/trace/bpf_trace.c:2445
#7: ffff88802c1ad1d8 (&qs->lock){..-.}-{2:2}, at: queue_stack_map_push_elem+0x1b2/0x660 kernel/bpf/queue_stack_maps.c:210
#8: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
#8: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
#8: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2402 [inline]
#8: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1fc/0x540 kernel/trace/bpf_trace.c:2444
stack backtrace:
CPU: 0 PID: 6168 Comm: syz-executor.3 Not tainted 6.9.0-syzkaller-12162-gf85af9d955ac #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
check_deadlock kernel/locking/lockdep.c:3062 [inline]
validate_chain+0x15d3/0x5900 kernel/locking/lockdep.c:3856
__lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
__queue_map_get+0x14b/0x4d0 kernel/bpf/queue_stack_maps.c:105
bpf_prog_94b194d4ebfffdd5+0x45/0x49
bpf_dispatcher_nop_func include/linux/bpf.h:1243 [inline]
__bpf_prog_run include/linux/filter.h:691 [inline]
bpf_prog_run include/linux/filter.h:698 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2403 [inline]
bpf_trace_run2+0x2ec/0x540 kernel/trace/bpf_trace.c:2444
trace_contention_end+0x114/0x140 include/trace/events/lock.h:122
__pv_queued_spin_lock_slowpath+0xb81/0xdc0 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
queue_stack_map_push_elem+0x1b2/0x660 kernel/bpf/queue_stack_maps.c:210
bpf_prog_216c997a1f42e404+0x3f/0x43
bpf_dispatcher_nop_func include/linux/bpf.h:1243 [inline]
__bpf_prog_run include/linux/filter.h:691 [inline]
bpf_prog_run include/linux/filter.h:698 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2403 [inline]
bpf_trace_run3+0x33a/0x5a0 kernel/trace/bpf_trace.c:2445
trace_kmem_cache_free include/trace/events/kmem.h:114 [inline]
kmem_cache_free+0x2a9/0x350 mm/slub.c:4510
rcu_do_batch kernel/rcu/tree.c:2535 [inline]
rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2809
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:percpu_counter_add_batch+0x29b/0x2f0 lib/percpu_counter.c:103
Code: 4d 85 e4 75 16 e8 65 67 af fc eb 15 e8 5e 67 af fc e8 09 4a 9f 06 4d 85 e4 74 ea e8 4f 67 af fc fb 48 c7 44 24 40 0e 36 e0 45 <48> 8b 44 24 38 49 c7 04 07 00 00 00 00 66 41 c7 44 07 09 00 00 41
RSP: 0018:ffffc90003ab71e0 EFLAGS: 00000293
RAX: ffffffff84e6ad31 RBX: 0000000000000000 RCX: ffff88802139bc00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90003ab72e0 R08: ffffffff84e6ad07 R09: 1ffffffff25f50b0
R10: dffffc0000000000 R11: fffffbfff25f50b1 R12: 0000000000000200
R13: 1ffff1100fe89edc R14: 0000000000000046 R15: dffffc0000000000
percpu_counter_add include/linux/percpu_counter.h:71 [inline]
add_mm_counter include/linux/mm.h:2640 [inline]
add_mm_rss_vec+0x78/0x310 mm/memory.c:481
copy_pte_range mm/memory.c:1178 [inline]
copy_pmd_range+0x7a6f/0x84c0 mm/memory.c:1240
copy_pud_range mm/memory.c:1277 [inline]
copy_p4d_range mm/memory.c:1301 [inline]
copy_page_range+0x99f/0xe90 mm/memory.c:1399
dup_mmap kernel/fork.c:751 [inline]
dup_mm kernel/fork.c:1688 [inline]
copy_mm+0x128d/0x2020 kernel/fork.c:1737
copy_process+0x187a/0x3dc0 kernel/fork.c:2390
kernel_clone+0x226/0x8f0 kernel/fork.c:2797
__do_sys_clone kernel/fork.c:2940 [inline]
__se_sys_clone kernel/fork.c:2924 [inline]
__x64_sys_clone+0x258/0x2a0 kernel/fork.c:2924
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:0x7f5818879f93
Code: 1f 84 00 00 00 00 00 64 48 8b 04 25 10 00 00 00 45 31 c0 31 d2 31 f6 bf 11 00 20 01 4c 8d 90 d0 02 00 00 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 89 c2 85 c0 75 2c 64 48 8b 04 25 10 00 00
RSP: 002b:00007ffc677d0888 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f5818879f93
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011
RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000
R10: 00005555599e2750 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000001
----------------
Code disassembly (best guess):
0: 4d 85 e4 test %r12,%r12
3: 75 16 jne 0x1b
5: e8 65 67 af fc call 0xfcaf676f
a: eb 15 jmp 0x21
c: e8 5e 67 af fc call 0xfcaf676f
11: e8 09 4a 9f 06 call 0x69f4a1f
16: 4d 85 e4 test %r12,%r12
19: 74 ea je 0x5
1b: e8 4f 67 af fc call 0xfcaf676f
20: fb sti
21: 48 c7 44 24 40 0e 36 movq $0x45e0360e,0x40(%rsp)
28: e0 45
* 2a: 48 8b 44 24 38 mov 0x38(%rsp),%rax <-- trapping instruction
2f: 49 c7 04 07 00 00 00 movq $0x0,(%r15,%rax,1)
36: 00
37: 66 41 c7 44 07 09 00 movw $0x0,0x9(%r15,%rax,1)
3e: 00
3f: 41 rex.B