============================================ WARNING: possible recursive locking detected 6.12.0-rc4-syzkaller-00161-gae90f6a6170d #0 Not tainted -------------------------------------------- syz.0.200/6804 is trying to acquire lock: ffffc9000c4e60d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1ea/0x600 kernel/bpf/ringbuf.c:427 but task is already holding lock: ffffc9000be770d8 (&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 4 locks held by syz.0.200/6804: #0: ffffffff8e937ee0 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #0: ffffffff8e937ee0 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2561 [inline] #0: ffffffff8e937ee0 (rcu_callback){....}-{0:0}, at: rcu_core+0xa37/0x17a0 kernel/rcu/tree.c:2823 #1: ffffffff8e937e20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #1: ffffffff8e937e20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #1: ffffffff8e937e20 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2315 [inline] #1: ffffffff8e937e20 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1fc/0x540 kernel/trace/bpf_trace.c:2357 #2: ffffc9000be770d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1ea/0x600 kernel/bpf/ringbuf.c:427 #3: ffffffff8e937e20 (rcu_read_lock){....}-{1:2}, at: trace_call_bpf+0xbc/0x8a0 stack backtrace: CPU: 0 UID: 0 PID: 6804 Comm: syz.0.200 Not tainted 6.12.0-rc4-syzkaller-00161-gae90f6a6170d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3037 check_deadlock kernel/locking/lockdep.c:3089 [inline] validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3891 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 __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_ccff7ebd8a0698ee+0x36/0x53 bpf_dispatcher_nop_func include/linux/bpf.h:1265 [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:2131 [inline] trace_call_bpf+0x369/0x8a0 kernel/trace/bpf_trace.c:146 perf_trace_run_bpf_submit+0x82/0x180 kernel/events/core.c:10416 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:5796 rcu_lock_acquire include/linux/rcupdate.h:337 [inline] rcu_read_lock include/linux/rcupdate.h:849 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2315 [inline] bpf_trace_run2+0x219/0x540 kernel/trace/bpf_trace.c:2357 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_8976cc69110aa25b+0x36/0x53 bpf_dispatcher_nop_func include/linux/bpf.h:1265 [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:2316 [inline] bpf_trace_run2+0x2ec/0x540 kernel/trace/bpf_trace.c:2357 trace_kfree include/trace/events/kmem.h:94 [inline] kfree+0x35e/0x440 mm/slub.c:4714 rcu_do_batch kernel/rcu/tree.c:2567 [inline] rcu_core+0xaaa/0x17a0 kernel/rcu/tree.c:2823 handle_softirqs+0x2c5/0x980 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:1049 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:finish_task_switch+0x1ea/0x870 kernel/sched/core.c:5202 Code: c9 50 e8 e9 00 0c 00 48 83 c4 08 4c 89 f7 e8 4d 39 00 00 0f 1f 44 00 00 4c 89 f7 e8 10 4f 6c 0a e8 cb 59 38 00 fb 48 8b 5d c0 <48> 8d bb f8 15 00 00 48 89 f8 48 c1 e8 03 49 be 00 00 00 00 00 fc RSP: 0018:ffffc90002f8f2e8 EFLAGS: 00000282 RAX: ec86d462f1733200 RBX: ffff88802589bc00 RCX: ffffffff9a3d1903 RDX: dffffc0000000000 RSI: ffffffff8c0acb40 RDI: ffffffff8c610360 RBP: ffffc90002f8f330 R08: ffffffff901d026f R09: 1ffffffff203a04d R10: dffffc0000000000 R11: fffffbfff203a04e R12: 1ffff110170c7f14 R13: dffffc0000000000 R14: ffff8880b863ea80 R15: ffff8880b863f8a0 context_switch kernel/sched/core.c:5331 [inline] __schedule+0x18b7/0x4bd0 kernel/sched/core.c:6690 preempt_schedule_irq+0xfb/0x1c0 kernel/sched/core.c:7012 irqentry_exit+0x5e/0x90 kernel/entry/common.c:354 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:obj_cgroup_put include/linux/memcontrol.h:827 [inline] RIP: 0010:mod_objcg_state+0x5d9/0x930 mm/memcontrol.c:2743 Code: 3c 23 00 74 08 4c 89 f7 e8 94 aa f6 ff f6 84 24 81 00 00 00 02 0f 85 89 00 00 00 41 f7 c7 00 02 00 00 74 01 fb 48 8b 7c 24 28 <48> 85 ff 74 05 e8 cd 8c 00 00 48 c7 44 24 60 0e 36 e0 45 48 8b 44 RSP: 0018:ffffc90002f8f6e0 EFLAGS: 00000206 RAX: ec86d462f1733200 RBX: 1ffff920005f1eec RCX: ffffffff9a3d1903 RDX: dffffc0000000000 RSI: ffffffff8c0acb40 RDI: 0000000000000000 RBP: ffffc90002f8f7e8 R08: ffffffff901d026f R09: 1ffffffff203a04d R10: dffffc0000000000 R11: fffffbfff203a04e R12: dffffc0000000000 R13: 0000000000000058 R14: ffffc90002f8f760 R15: 0000000000000246 __memcg_slab_free_hook+0x9f/0x310 mm/memcontrol.c:3011 memcg_slab_free_hook mm/slub.c:2182 [inline] slab_free mm/slub.c:4576 [inline] kfree+0x23d/0x440 mm/slub.c:4727 mq_create_mount ipc/mqueue.c:486 [inline] mq_init_ns+0x3d9/0x540 ipc/mqueue.c:1701 create_ipc_ns ipc/namespace.c:73 [inline] copy_ipcs+0x321/0x530 ipc/namespace.c:112 create_new_namespaces+0x221/0x7b0 kernel/nsproxy.c:90 copy_namespaces+0x41a/0x490 kernel/nsproxy.c:179 copy_process+0x1929/0x3d50 kernel/fork.c:2375 kernel_clone+0x226/0x8f0 kernel/fork.c:2784 __do_sys_clone kernel/fork.c:2927 [inline] __se_sys_clone kernel/fork.c:2911 [inline] __x64_sys_clone+0x258/0x2a0 kernel/fork.c:2911 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:0x7f9b7517e719 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:00007f9b76021fe8 EFLAGS: 00000202 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 00007f9b75335f80 RCX: 00007f9b7517e719 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000008020440 RBP: 00007f9b751f132e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f9b75335f80 R15: 00007ffeddd592a8 ---------------- Code disassembly (best guess): 0: c9 leave 1: 50 push %rax 2: e8 e9 00 0c 00 call 0xc00f0 7: 48 83 c4 08 add $0x8,%rsp b: 4c 89 f7 mov %r14,%rdi e: e8 4d 39 00 00 call 0x3960 13: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 18: 4c 89 f7 mov %r14,%rdi 1b: e8 10 4f 6c 0a call 0xa6c4f30 20: e8 cb 59 38 00 call 0x3859f0 25: fb sti 26: 48 8b 5d c0 mov -0x40(%rbp),%rbx * 2a: 48 8d bb f8 15 00 00 lea 0x15f8(%rbx),%rdi <-- trapping instruction 31: 48 89 f8 mov %rdi,%rax 34: 48 c1 e8 03 shr $0x3,%rax 38: 49 rex.WB 39: be 00 00 00 00 mov $0x0,%esi 3e: 00 fc add %bh,%ah