============================================ WARNING: possible recursive locking detected 6.11.0-rc3-next-20240816-syzkaller #0 Not tainted -------------------------------------------- syz-executor/5225 is trying to acquire lock: ffffc90004e9d0d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1ea/0x600 kernel/bpf/ringbuf.c:427 but task is already holding lock: ffffc90004e790d8 (&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 5 locks held by syz-executor/5225: #0: ffff888078c40198 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock include/linux/mmap_lock.h:106 [inline] #0: ffff888078c40198 (&mm->mmap_lock){++++}-{3:3}, at: exit_mmap+0x2bd/0xc40 mm/mmap.c:1929 #1: ffff8880296df188 (&anon_vma->rwsem){++++}-{3:3}, at: lock_anon_vma_root mm/rmap.c:251 [inline] #1: ffff8880296df188 (&anon_vma->rwsem){++++}-{3:3}, at: unlink_anon_vmas+0xd5/0x5f0 mm/rmap.c:409 #2: ffffffff8e939720 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #2: ffffffff8e939720 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #2: ffffffff8e939720 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2337 [inline] #2: ffffffff8e939720 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run3+0x24c/0x5a0 kernel/trace/bpf_trace.c:2380 #3: ffffc90004e790d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1ea/0x600 kernel/bpf/ringbuf.c:427 #4: ffffffff8e939720 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #4: ffffffff8e939720 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #4: ffffffff8e939720 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2337 [inline] #4: ffffffff8e939720 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1fc/0x540 kernel/trace/bpf_trace.c:2379 stack backtrace: CPU: 1 UID: 0 PID: 5225 Comm: syz-executor Not tainted 6.11.0-rc3-next-20240816-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 check_deadlock kernel/locking/lockdep.c:3064 [inline] validate_chain+0x15d3/0x5900 kernel/locking/lockdep.c:3858 __lock_acquire+0x137a/0x2040 kernel/locking/lockdep.c:5145 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5762 __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_0e153dac479590bf+0x35/0x70 bpf_dispatcher_nop_func include/linux/bpf.h:1252 [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:2338 [inline] bpf_trace_run2+0x2ec/0x540 kernel/trace/bpf_trace.c:2379 trace_contention_begin+0x117/0x140 include/trace/events/lock.h:95 __pv_queued_spin_lock_slowpath+0x114/0xdb0 kernel/locking/qspinlock.c:402 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_output kernel/bpf/ringbuf.c:553 [inline] bpf_ringbuf_output+0x67/0x1e0 kernel/bpf/ringbuf.c:543 bpf_prog_918f90024333f9ff+0x43/0x47 bpf_dispatcher_nop_func include/linux/bpf.h:1252 [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:2338 [inline] bpf_trace_run3+0x33a/0x5a0 kernel/trace/bpf_trace.c:2380 __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+0x327/0x3d0 mm/slub.c:4618 anon_vma_chain_free mm/rmap.c:148 [inline] unlink_anon_vmas+0x297/0x5f0 mm/rmap.c:422 free_pgtables+0x2a1/0x840 mm/memory.c:388 exit_mmap+0x48e/0xc40 mm/mmap.c:1932 __mmput+0x115/0x390 kernel/fork.c:1347 exit_mm+0x220/0x310 kernel/exit.c:571 do_exit+0x9b2/0x28e0 kernel/exit.c:926 do_group_exit+0x207/0x2c0 kernel/exit.c:1088 get_signal+0x176f/0x1810 kernel/signal.c:2936 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0xc9/0x370 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f10cf3700d7 Code: Unable to access opcode bytes at 0x7f10cf3700ad. RSP: 002b:00007ffd9c7594d0 EFLAGS: 00000293 ORIG_RAX: 000000000000003d RAX: fffffffffffffe00 RBX: 000000000000006f RCX: 00007f10cf3700d7 RDX: 0000000040000000 RSI: 00007ffd9c75952c RDI: 00000000ffffffff RBP: 00007ffd9c75952c R08: 0000000000000000 R09: 7fffffffffffffff R10: 0000000000000000 R11: 0000000000000293 R12: 00005555710e75eb R13: 00005555710e7590 R14: 000000000001a655 R15: 00007ffd9c759580