============================================ WARNING: possible recursive locking detected 6.1.104-syzkaller #0 Not tainted -------------------------------------------- syz.1.13/3751 is trying to acquire lock: ffffc900046d90d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1e6/0x600 kernel/bpf/ringbuf.c:413 but task is already holding lock: ffffc900046910d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1e6/0x600 kernel/bpf/ringbuf.c:413 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 7 locks held by syz.1.13/3751: #0: ffffffff8d3c59b0 (dup_mmap_sem){.+.+}-{0:0}, at: dup_mmap kernel/fork.c:592 [inline] #0: ffffffff8d3c59b0 (dup_mmap_sem){.+.+}-{0:0}, at: dup_mm kernel/fork.c:1540 [inline] #0: ffffffff8d3c59b0 (dup_mmap_sem){.+.+}-{0:0}, at: copy_mm+0x3cb/0x1990 kernel/fork.c:1589 #1: ffff888073e75b58 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline] #1: ffff888073e75b58 (&mm->mmap_lock){++++}-{3:3}, at: dup_mmap kernel/fork.c:593 [inline] #1: ffff888073e75b58 (&mm->mmap_lock){++++}-{3:3}, at: dup_mm kernel/fork.c:1540 [inline] #1: ffff888073e75b58 (&mm->mmap_lock){++++}-{3:3}, at: copy_mm+0x3e5/0x1990 kernel/fork.c:1589 #2: ffff888079486a58 (&mm->mmap_lock/1){+.+.}-{3:3}, at: mmap_write_lock_nested include/linux/mmap_lock.h:78 [inline] #2: ffff888079486a58 (&mm->mmap_lock/1){+.+.}-{3:3}, at: dup_mmap kernel/fork.c:602 [inline] #2: ffff888079486a58 (&mm->mmap_lock/1){+.+.}-{3:3}, at: dup_mm kernel/fork.c:1540 [inline] #2: ffff888079486a58 (&mm->mmap_lock/1){+.+.}-{3:3}, at: copy_mm+0x4ca/0x1990 kernel/fork.c:1589 #3: ffff8880b993a9d8 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537 #4: ffffffff8d32afc0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #4: ffffffff8d32afc0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #4: ffffffff8d32afc0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline] #4: ffffffff8d32afc0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run4+0x16a/0x470 kernel/trace/bpf_trace.c:2314 #5: ffffc900046910d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1e6/0x600 kernel/bpf/ringbuf.c:413 #6: ffffffff8d32afc0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #6: ffffffff8d32afc0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #6: ffffffff8d32afc0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline] #6: ffffffff8d32afc0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x110/0x410 kernel/trace/bpf_trace.c:2312 stack backtrace: CPU: 1 PID: 3751 Comm: syz.1.13 Not tainted 6.1.104-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_deadlock_bug kernel/locking/lockdep.c:2983 [inline] check_deadlock kernel/locking/lockdep.c:3026 [inline] validate_chain+0x4711/0x5950 kernel/locking/lockdep.c:3812 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162 __bpf_ringbuf_reserve+0x1e6/0x600 kernel/bpf/ringbuf.c:413 ____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:464 [inline] bpf_ringbuf_reserve+0x58/0x70 kernel/bpf/ringbuf.c:456 bpf_prog_52da899f40574008+0x25/0x42 bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline] bpf_trace_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312 trace_contention_end+0x14c/0x190 include/trace/events/lock.h:122 __pv_queued_spin_lock_slowpath+0x935/0xc50 kernel/locking/qspinlock.c:560 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [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+0x269/0x370 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0xdd/0x120 kernel/locking/spinlock.c:162 __bpf_ringbuf_reserve+0x1e6/0x600 kernel/bpf/ringbuf.c:413 ____bpf_ringbuf_output kernel/bpf/ringbuf.c:539 [inline] bpf_ringbuf_output+0x63/0x1e0 kernel/bpf/ringbuf.c:529 bpf_prog_a3e2825f60354855+0x3d/0x41 bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline] bpf_trace_run4+0x253/0x470 kernel/trace/bpf_trace.c:2314 __traceiter_sched_switch+0x91/0xc0 include/trace/events/sched.h:222 trace_sched_switch include/trace/events/sched.h:222 [inline] __schedule+0x2128/0x4570 kernel/sched/core.c:6555 preempt_schedule_common+0x83/0xd0 kernel/sched/core.c:6727 preempt_schedule+0xd9/0xe0 kernel/sched/core.c:6751 preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:34 __raw_spin_unlock include/linux/spinlock_api_smp.h:143 [inline] _raw_spin_unlock+0x36/0x40 kernel/locking/spinlock.c:186 spin_unlock include/linux/spinlock.h:391 [inline] copy_pte_range mm/memory.c:1116 [inline] copy_pmd_range mm/memory.c:1177 [inline] copy_pud_range mm/memory.c:1214 [inline] copy_p4d_range mm/memory.c:1238 [inline] copy_page_range+0x3ca3/0x4660 mm/memory.c:1336 dup_mmap kernel/fork.c:696 [inline] dup_mm kernel/fork.c:1540 [inline] copy_mm+0xf42/0x1990 kernel/fork.c:1589 copy_process+0x19d5/0x4060 kernel/fork.c:2267 kernel_clone+0x222/0x920 kernel/fork.c:2682 __do_sys_clone kernel/fork.c:2823 [inline] __se_sys_clone kernel/fork.c:2807 [inline] __x64_sys_clone+0x231/0x280 kernel/fork.c:2807 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7feb43f799f9 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:00007feb43dfefe8 EFLAGS: 00000206 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 00007feb44115f80 RCX: 00007feb43f799f9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000022023400 RBP: 00007feb43fe78ee R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000 R13: 0000000000000000 R14: 00007feb44115f80 R15: 00007ffe35375c78