============================================ WARNING: possible recursive locking detected 6.14.0-syzkaller-g8582d9ab3efd #0 Not tainted -------------------------------------------- syz.4.365/7183 is trying to acquire lock: ffffc9000e9c70d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x20e/0x650 kernel/bpf/ringbuf.c:423 but task is already holding lock: ffffc90004a8d0d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x20e/0x650 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 syz.4.365/7183: #0: ffff88807aa333e0 (&mm->mmap_lock){++++}-{4:4}, at: mmap_write_lock include/linux/mmap_lock.h:128 [inline] #0: ffff88807aa333e0 (&mm->mmap_lock){++++}-{4:4}, at: exit_mmap+0x305/0xde0 mm/mmap.c:1292 #1: ffffffff8ed3df60 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:331 [inline] #1: ffffffff8ed3df60 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline] #1: ffffffff8ed3df60 (rcu_read_lock){....}-{1:3}, at: percpu_ref_get_many+0x19/0x140 include/linux/percpu-refcount.h:202 #2: ffff8880b8639b18 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:605 #3: ffffffff8ed3df60 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:331 [inline] #3: ffffffff8ed3df60 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:841 [inline] #3: ffffffff8ed3df60 (rcu_read_lock){....}-{1:3}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2362 [inline] #3: ffffffff8ed3df60 (rcu_read_lock){....}-{1:3}, at: bpf_trace_run2+0x1fe/0x550 kernel/trace/bpf_trace.c:2404 #4: ffffc90004a8d0d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x20e/0x650 kernel/bpf/ringbuf.c:423 #5: ffffffff8ed3df60 (rcu_read_lock){....}-{1:3}, at: trace_call_bpf+0xb9/0x8a0 kernel/trace/bpf_trace.c:-1 stack backtrace: CPU: 0 UID: 0 PID: 7183 Comm: syz.4.365 Not tainted 6.14.0-syzkaller-g8582d9ab3efd #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_deadlock_bug+0x2be/0x2d0 kernel/locking/lockdep.c:3042 check_deadlock kernel/locking/lockdep.c:3094 [inline] validate_chain+0x928/0x24e0 kernel/locking/lockdep.c:3896 __lock_acquire+0xad5/0xd80 kernel/locking/lockdep.c:5235 lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd8/0x130 kernel/locking/spinlock.c:162 __bpf_ringbuf_reserve+0x20e/0x650 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_ba4789e7f2e155d6+0x36/0x53 bpf_dispatcher_nop_func include/linux/bpf.h:1316 [inline] __bpf_prog_run include/linux/filter.h:718 [inline] bpf_prog_run include/linux/filter.h:725 [inline] bpf_prog_run_array include/linux/bpf.h:2215 [inline] trace_call_bpf+0x36a/0x8a0 kernel/trace/bpf_trace.c:146 perf_trace_run_bpf_submit+0x82/0x180 kernel/events/core.c:10807 do_perf_trace_lock include/trace/events/lock.h:50 [inline] perf_trace_lock+0x39c/0x4a0 include/trace/events/lock.h:50 __do_trace_lock_release include/trace/events/lock.h:69 [inline] trace_lock_release include/trace/events/lock.h:69 [inline] lock_release+0x3b4/0x3e0 kernel/locking/lockdep.c:5877 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:149 [inline] _raw_spin_unlock_irqrestore+0x7a/0x140 kernel/locking/spinlock.c:194 __bpf_ringbuf_reserve+0x4f8/0x650 kernel/bpf/ringbuf.c:449 ____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:474 [inline] bpf_ringbuf_reserve+0x5c/0x70 kernel/bpf/ringbuf.c:466 bpf_prog_0a05816d5ae8e009+0x3f/0x97 bpf_dispatcher_nop_func include/linux/bpf.h:1316 [inline] __bpf_prog_run include/linux/filter.h:718 [inline] bpf_prog_run include/linux/filter.h:725 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2363 [inline] bpf_trace_run2+0x2ee/0x550 kernel/trace/bpf_trace.c:2404 __bpf_trace_tlb_flush+0x176/0x230 include/trace/events/tlb.h:38 __do_trace_tlb_flush include/trace/events/tlb.h:38 [inline] trace_tlb_flush+0x11c/0x140 include/trace/events/tlb.h:38 switch_mm_irqs_off+0x5da/0xb00 arch/x86/mm/tlb.c:-1 context_switch kernel/sched/core.c:5366 [inline] __schedule+0x13a1/0x5240 kernel/sched/core.c:6767 preempt_schedule_notrace+0x103/0x140 kernel/sched/core.c:7040 preempt_schedule_notrace_thunk+0x16/0x30 arch/x86/entry/thunk.S:13 class_preempt_notrace_destructor include/linux/preempt.h:482 [inline] __do_trace_lock_release include/trace/events/lock.h:69 [inline] trace_lock_release include/trace/events/lock.h:69 [inline] lock_release+0x3cc/0x3e0 kernel/locking/lockdep.c:5877 rcu_lock_release include/linux/rcupdate.h:341 [inline] rcu_read_unlock include/linux/rcupdate.h:871 [inline] percpu_ref_get_many+0xfa/0x140 include/linux/percpu-refcount.h:209 percpu_ref_get include/linux/percpu-refcount.h:222 [inline] css_get include/linux/cgroup_refcnt.h:11 [inline] uncharge_folio+0x226/0x680 mm/memcontrol.c:4753 __mem_cgroup_uncharge_folios+0xf3/0x1e0 mm/memcontrol.c:4797 mem_cgroup_uncharge_folios include/linux/memcontrol.h:670 [inline] folios_put_refs+0x702/0x800 mm/swap.c:991 free_pages_and_swap_cache+0x2ea/0x6a0 mm/swap_state.c:267 __tlb_batch_free_encoded_pages mm/mmu_gather.c:136 [inline] tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:397 [inline] tlb_flush_mmu+0x3a9/0x690 mm/mmu_gather.c:404 tlb_finish_mmu+0xd4/0x200 mm/mmu_gather.c:496 exit_mmap+0x5b1/0xde0 mm/mmap.c:1297 __mmput+0x115/0x420 kernel/fork.c:1379 exit_mm+0x221/0x310 kernel/exit.c:589 do_exit+0x994/0x27f0 kernel/exit.c:940 do_group_exit+0x207/0x2c0 kernel/exit.c:1102 __do_sys_exit_group kernel/exit.c:1113 [inline] __se_sys_exit_group kernel/exit.c:1111 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1111 x64_sys_call+0x26c3/0x26d0 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f65a278e169 Code: Unable to access opcode bytes at 0x7f65a278e13f. RSP: 002b:00007ffe6636c848 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f65a278e169 RDX: 0000000000000064 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007ffe6636c8ac R08: 0000001a6636c93f R09: 00000000000927c0 R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000045 R13: 00000000000927c0 R14: 000000000002127e R15: 00007ffe6636c900