============================================ WARNING: possible recursive locking detected 6.11.0-syzkaller-08829-gaf9c191ac2a0 #0 Not tainted -------------------------------------------- syz.0.67/5572 is trying to acquire lock: ffff88802426b9e0 (&qs->lock){..-.}-{2:2}, at: queue_stack_map_push_elem+0x1b2/0x660 kernel/bpf/queue_stack_maps.c:210 but task is already holding lock: ffff88805b3479e0 (&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 7 locks held by syz.0.67/5572: #0: ffff88807ee54420 (sb_writers#10){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:515 #1: ffff88807790e988 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:850 [inline] #1: ffff88807790e988 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: filename_create+0x260/0x540 fs/namei.c:4026 #2: ffffffff8e96c5e8 (cgroup_mutex){+.+.}-{3:3}, at: cgroup_lock include/linux/cgroup.h:368 [inline] #2: ffffffff8e96c5e8 (cgroup_mutex){+.+.}-{3:3}, at: cgroup_kn_lock_live+0xe6/0x290 kernel/cgroup/cgroup.c:1662 #3: ffffffff8e937fa0 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #3: ffffffff8e937fa0 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2561 [inline] #3: ffffffff8e937fa0 (rcu_callback){....}-{0:0}, at: rcu_core+0xa37/0x17a0 kernel/rcu/tree.c:2823 #4: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #4: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #4: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2317 [inline] #4: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1fc/0x540 kernel/trace/bpf_trace.c:2359 #5: ffff88805b3479e0 (&qs->lock){..-.}-{2:2}, at: queue_stack_map_push_elem+0x1b2/0x660 kernel/bpf/queue_stack_maps.c:210 #6: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #6: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #6: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2317 [inline] #6: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1fc/0x540 kernel/trace/bpf_trace.c:2359 stack backtrace: CPU: 0 UID: 0 PID: 5572 Comm: syz.0.67 Not tainted 6.11.0-syzkaller-08829-gaf9c191ac2a0 #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 print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3034 check_deadlock kernel/locking/lockdep.c:3086 [inline] validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3888 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5199 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 queue_stack_map_push_elem+0x1b2/0x660 kernel/bpf/queue_stack_maps.c:210 bpf_prog_216c997a1f42e404+0x40/0x48 bpf_dispatcher_nop_func include/linux/bpf.h:1257 [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:2318 [inline] bpf_trace_run2+0x2ee/0x540 kernel/trace/bpf_trace.c:2359 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 queue_stack_map_push_elem+0x1b2/0x660 kernel/bpf/queue_stack_maps.c:210 bpf_prog_216c997a1f42e404+0x40/0x48 bpf_dispatcher_nop_func include/linux/bpf.h:1257 [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:2318 [inline] bpf_trace_run2+0x2ee/0x540 kernel/trace/bpf_trace.c:2359 trace_kfree include/trace/events/kmem.h:94 [inline] kfree+0x35e/0x440 mm/slub.c:4715 slab_free_after_rcu_debug+0x62/0x290 mm/slub.c:4617 rcu_do_batch kernel/rcu/tree.c:2567 [inline] rcu_core+0xaac/0x17a0 kernel/rcu/tree.c:2823 handle_softirqs+0x2c7/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:1037 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1037 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:unwind_next_frame+0x18ed/0x22d0 arch/x86/kernel/unwind_orc.c:672 Code: 0c 01 75 40 80 3d c2 d2 d9 11 00 75 37 c6 05 b9 d2 d9 11 01 e9 21 fa ff ff bf 01 00 00 00 e8 9a c5 21 00 65 8b 0d ab 98 c2 7e 01 85 c9 75 73 e8 48 77 bf ff eb 6c 80 3d 4d 05 c5 0e 00 0f 84 RSP: 0018:ffffc900049c7630 EFLAGS: 00000297 RAX: 0000000080000001 RBX: ffffc900049c7710 RCX: 0000000080000000 RDX: dffffc0000000000 RSI: ffffc900049c0000 RDI: 0000000000000001 RBP: ffffc900049c7700 R08: ffffc900049c7ae0 R09: ffffc900049c7750 R10: dffffc0000000000 R11: fffff52000938eec R12: dffffc0000000000 R13: ffffc900049c7700 R14: ffffc900049c0000 R15: ffffc900049c7af0 arch_stack_walk+0x11c/0x150 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x118/0x1d0 kernel/stacktrace.c:122 kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:257 [inline] __do_kmalloc_node mm/slub.c:4265 [inline] __kmalloc_noprof+0x1fc/0x400 mm/slub.c:4277 kmalloc_noprof include/linux/slab.h:882 [inline] kmalloc_array_noprof include/linux/slab.h:923 [inline] alloc_fair_sched_group+0xc4/0xa10 kernel/sched/fair.c:13315 sched_create_group+0x37/0x80 kernel/sched/core.c:8812 cpu_cgroup_css_alloc+0xe/0x40 kernel/sched/core.c:8972 css_create kernel/cgroup/cgroup.c:5631 [inline] cgroup_apply_control_enable+0x39e/0xaf0 kernel/cgroup/cgroup.c:3239 cgroup_mkdir+0xa52/0xd30 kernel/cgroup/cgroup.c:5845 kernfs_iop_mkdir+0x255/0x3f0 fs/kernfs/dir.c:1246 vfs_mkdir+0x2fb/0x4f0 fs/namei.c:4257 do_mkdirat+0x264/0x3a0 fs/namei.c:4280 __do_sys_mkdir fs/namei.c:4300 [inline] __se_sys_mkdir fs/namei.c:4298 [inline] __x64_sys_mkdir+0x6c/0x80 fs/namei.c:4298 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:0x7f8bfe77def9 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:00007f8bff63f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000053 RAX: ffffffffffffffda RBX: 00007f8bfe935f80 RCX: 00007f8bfe77def9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000000 RBP: 00007f8bfe7f0b76 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f8bfe935f80 R15: 00007ffe75370d78 ---------------- Code disassembly (best guess): 0: 0c 01 or $0x1,%al 2: 75 40 jne 0x44 4: 80 3d c2 d2 d9 11 00 cmpb $0x0,0x11d9d2c2(%rip) # 0x11d9d2cd b: 75 37 jne 0x44 d: c6 05 b9 d2 d9 11 01 movb $0x1,0x11d9d2b9(%rip) # 0x11d9d2cd 14: e9 21 fa ff ff jmp 0xfffffa3a 19: bf 01 00 00 00 mov $0x1,%edi 1e: e8 9a c5 21 00 call 0x21c5bd 23: 65 8b 0d ab 98 c2 7e mov %gs:0x7ec298ab(%rip),%ecx # 0x7ec298d5 * 2a: b0 01 mov $0x1,%al <-- trapping instruction 2c: 85 c9 test %ecx,%ecx 2e: 75 73 jne 0xa3 30: e8 48 77 bf ff call 0xffbf777d 35: eb 6c jmp 0xa3 37: 80 3d 4d 05 c5 0e 00 cmpb $0x0,0xec5054d(%rip) # 0xec5058b 3e: 0f .byte 0xf 3f: 84 .byte 0x84