============================================ WARNING: possible recursive locking detected 6.9.0-rc7-syzkaller-00136-gf4345f05c0df #0 Not tainted -------------------------------------------- syz-executor.4/10845 is trying to acquire lock: ffff88802c72d9d8 (&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: ffff88807f79a9d8 (&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 11 locks held by syz-executor.4/10845: #0: ffffffff8e3df4f0 (dup_mmap_sem){.+.+}-{0:0}, at: dup_mmap kernel/fork.c:637 [inline] #0: ffffffff8e3df4f0 (dup_mmap_sem){.+.+}-{0:0}, at: dup_mm kernel/fork.c:1688 [inline] #0: ffffffff8e3df4f0 (dup_mmap_sem){.+.+}-{0:0}, at: copy_mm+0x275/0x2180 kernel/fork.c:1737 #1: ffff88807b0b3aa0 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:124 [inline] #1: ffff88807b0b3aa0 (&mm->mmap_lock){++++}-{3:3}, at: dup_mmap kernel/fork.c:638 [inline] #1: ffff88807b0b3aa0 (&mm->mmap_lock){++++}-{3:3}, at: dup_mm kernel/fork.c:1688 [inline] #1: ffff88807b0b3aa0 (&mm->mmap_lock){++++}-{3:3}, at: copy_mm+0x295/0x2180 kernel/fork.c:1737 #2: ffff8880150773a0 (&mm->mmap_lock/1){+.+.}-{3:3}, at: mmap_write_lock_nested include/linux/mmap_lock.h:115 [inline] #2: ffff8880150773a0 (&mm->mmap_lock/1){+.+.}-{3:3}, at: dup_mmap kernel/fork.c:647 [inline] #2: ffff8880150773a0 (&mm->mmap_lock/1){+.+.}-{3:3}, at: dup_mm kernel/fork.c:1688 [inline] #2: ffff8880150773a0 (&mm->mmap_lock/1){+.+.}-{3:3}, at: copy_mm+0x3d1/0x2180 kernel/fork.c:1737 #3: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #3: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #3: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: __pte_offset_map+0x82/0x380 mm/pgtable-generic.c:285 #4: ffff888064092738 (ptlock_ptr(ptdesc)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline] #4: ffff888064092738 (ptlock_ptr(ptdesc)#2){+.+.}-{2:2}, at: __pte_offset_map_lock+0x1ba/0x300 mm/pgtable-generic.c:373 #5: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #5: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #5: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: __pte_offset_map+0x82/0x380 mm/pgtable-generic.c:285 #6: ffff88802c917b58 (ptlock_ptr(ptdesc)#2/1){+.+.}-{2:2}, at: copy_pte_range mm/memory.c:1103 [inline] #6: ffff88802c917b58 (ptlock_ptr(ptdesc)#2/1){+.+.}-{2:2}, at: copy_pmd_range mm/memory.c:1238 [inline] #6: ffff88802c917b58 (ptlock_ptr(ptdesc)#2/1){+.+.}-{2:2}, at: copy_pud_range mm/memory.c:1275 [inline] #6: ffff88802c917b58 (ptlock_ptr(ptdesc)#2/1){+.+.}-{2:2}, at: copy_p4d_range mm/memory.c:1299 [inline] #6: ffff88802c917b58 (ptlock_ptr(ptdesc)#2/1){+.+.}-{2:2}, at: copy_page_range+0x11c7/0x5b00 mm/memory.c:1397 #7: ffffffff8e334e60 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #7: ffffffff8e334e60 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2190 [inline] #7: ffffffff8e334e60 (rcu_callback){....}-{0:0}, at: rcu_core+0xa86/0x1830 kernel/rcu/tree.c:2471 #8: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #8: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #8: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2380 [inline] #8: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run3+0x14a/0x460 kernel/trace/bpf_trace.c:2421 #9: ffff88807f79a9d8 (&qs->lock){-.-.}-{2:2}, at: queue_stack_map_push_elem+0x1b2/0x660 kernel/bpf/queue_stack_maps.c:210 #10: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #10: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #10: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2380 [inline] #10: ffffffff8e334da0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x114/0x420 kernel/trace/bpf_trace.c:2420 stack backtrace: CPU: 0 PID: 10845 Comm: syz-executor.4 Not tainted 6.9.0-rc7-syzkaller-00136-gf4345f05c0df #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 check_deadlock kernel/locking/lockdep.c:3062 [inline] validate_chain+0x15c1/0x58e0 kernel/locking/lockdep.c:3856 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __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_80daba7f9ca62790+0x42/0x46 bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline] __bpf_prog_run include/linux/filter.h:657 [inline] bpf_prog_run include/linux/filter.h:664 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline] bpf_trace_run2+0x204/0x420 kernel/trace/bpf_trace.c:2420 trace_contention_end+0x114/0x140 include/trace/events/lock.h:122 __pv_queued_spin_lock_slowpath+0x939/0xc60 kernel/locking/qspinlock.c:560 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+0x3f/0x43 bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline] __bpf_prog_run include/linux/filter.h:657 [inline] bpf_prog_run include/linux/filter.h:664 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2381 [inline] bpf_trace_run3+0x238/0x460 kernel/trace/bpf_trace.c:2421 __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+0x267/0x2d0 mm/slub.c:4349 put_pid+0xb5/0x120 kernel/pid.c:121 proc_free_inode+0x4c/0xa0 fs/proc/inode.c:76 rcu_do_batch kernel/rcu/tree.c:2196 [inline] rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2471 handle_softirqs+0x2d6/0x990 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:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:__page_table_check_ptes_set+0x14e/0x280 mm/page_table_check.c:193 Code: 4c 31 f7 48 c1 ef 0c 48 b8 ff ff ff ff ff 00 00 00 48 21 c7 be 01 00 00 00 e8 fe f5 ff ff eb 05 e8 17 94 92 ff 4c 39 64 24 18 <48> bb 00 00 00 00 00 fc ff df 74 0e e8 01 94 92 ff 49 83 c4 08 e9 RSP: 0018:ffffc90004917300 EFLAGS: 00000246 RAX: ffffffff82037379 RBX: 0000000000000000 RCX: ffff88802a9e0000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005 RBP: ffffc900049173b0 R08: ffffffff82037336 R09: 1ffffd40003df5f8 R10: dffffc0000000000 R11: fffff940003df5f9 R12: 0000000000000000 R13: ffff88807b4377e0 R14: 0000000000000000 R15: 1ffff92000922e68 page_table_check_ptes_set include/linux/page_table_check.h:74 [inline] set_ptes include/linux/pgtable.h:267 [inline] __copy_present_ptes mm/memory.c:953 [inline] copy_present_ptes mm/memory.c:1036 [inline] copy_pte_range mm/memory.c:1151 [inline] copy_pmd_range mm/memory.c:1238 [inline] copy_pud_range mm/memory.c:1275 [inline] copy_p4d_range mm/memory.c:1299 [inline] copy_page_range+0x3d98/0x5b00 mm/memory.c:1397 dup_mmap kernel/fork.c:751 [inline] dup_mm kernel/fork.c:1688 [inline] copy_mm+0x1321/0x2180 kernel/fork.c:1737 copy_process+0x187a/0x3df0 kernel/fork.c:2390 kernel_clone+0x223/0x870 kernel/fork.c:2797 __do_sys_clone kernel/fork.c:2940 [inline] __se_sys_clone kernel/fork.c:2924 [inline] __x64_sys_clone+0x258/0x2a0 kernel/fork.c:2924 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7ff37b87ad93 Code: 1f 84 00 00 00 00 00 64 48 8b 04 25 10 00 00 00 45 31 c0 31 d2 31 f6 bf 11 00 20 01 4c 8d 90 d0 02 00 00 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 89 c2 85 c0 75 2c 64 48 8b 04 25 10 00 00 RSP: 002b:00007ffec8855ec8 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ff37b87ad93 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 R10: 00005555652d7750 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000001 ---------------- Code disassembly (best guess): 0: 4c 31 f7 xor %r14,%rdi 3: 48 c1 ef 0c shr $0xc,%rdi 7: 48 b8 ff ff ff ff ff movabs $0xffffffffff,%rax e: 00 00 00 11: 48 21 c7 and %rax,%rdi 14: be 01 00 00 00 mov $0x1,%esi 19: e8 fe f5 ff ff call 0xfffff61c 1e: eb 05 jmp 0x25 20: e8 17 94 92 ff call 0xff92943c 25: 4c 39 64 24 18 cmp %r12,0x18(%rsp) * 2a: 48 bb 00 00 00 00 00 movabs $0xdffffc0000000000,%rbx <-- trapping instruction 31: fc ff df 34: 74 0e je 0x44 36: e8 01 94 92 ff call 0xff92943c 3b: 49 83 c4 08 add $0x8,%r12 3f: e9 .byte 0xe9