====================================================== WARNING: possible circular locking dependency detected 5.15.163-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor/3568 is trying to acquire lock: ffff8880b9b35bb8 (lock#9){+.+.}-{2:2}, at: local_lock_acquire+0xd/0x170 include/linux/local_lock_internal.h:28 but task is already holding lock: ffff8880b9b3a358 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:475 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&rq->__lock){-.-.}-{2:2}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 _raw_spin_lock_nested+0x2d/0x40 kernel/locking/spinlock.c:368 raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:475 raw_spin_rq_lock kernel/sched/sched.h:1326 [inline] rq_lock kernel/sched/sched.h:1621 [inline] task_fork_fair+0x5d/0x350 kernel/sched/fair.c:11495 sched_cgroup_fork+0x2d3/0x330 kernel/sched/core.c:4466 copy_process+0x224a/0x3ef0 kernel/fork.c:2320 kernel_clone+0x210/0x960 kernel/fork.c:2604 kernel_thread+0x168/0x1e0 kernel/fork.c:2656 rest_init+0x21/0x330 init/main.c:706 start_kernel+0x48c/0x540 init/main.c:1140 secondary_startup_64_no_verify+0xb1/0xbb -> #1 (&p->pi_lock){-.-.}-{2:2}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162 try_to_wake_up+0xae/0x1300 kernel/sched/core.c:4030 rcu_read_unlock_special+0x3aa/0x520 kernel/rcu/tree_plugin.h:650 __rcu_read_unlock+0x92/0x100 kernel/rcu/tree_plugin.h:422 rcu_read_unlock include/linux/rcupdate.h:771 [inline] get_mem_cgroup_from_mm+0x179/0x260 mm/memcontrol.c:992 get_mm_memcg_path+0x1b/0x550 mm/mmap_lock.c:202 __mmap_lock_do_trace_acquire_returned+0x84/0x340 mm/mmap_lock.c:237 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline] mmap_read_trylock include/linux/mmap_lock.h:137 [inline] do_user_addr_fault arch/x86/mm/fault.c:1298 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x564/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 copy_user_enhanced_fast_string+0xe/0x40 arch/x86/lib/copy_user_64.S:205 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_from_user arch/x86/include/asm/uaccess_64.h:52 [inline] _copy_from_user+0xf9/0x170 lib/usercopy.c:23 copy_from_user include/linux/uaccess.h:192 [inline] copy_from_bpfptr_offset include/linux/bpfptr.h:52 [inline] copy_from_bpfptr include/linux/bpfptr.h:58 [inline] kvmemdup_bpfptr include/linux/bpfptr.h:73 [inline] ___bpf_copy_key kernel/bpf/syscall.c:1060 [inline] map_update_elem+0x3aa/0x7c0 kernel/bpf/syscall.c:1168 __sys_bpf+0x2fd/0x670 kernel/bpf/syscall.c:4639 __do_sys_bpf kernel/bpf/syscall.c:4755 [inline] __se_sys_bpf kernel/bpf/syscall.c:4753 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4753 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (lock#9){+.+.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 local_lock_acquire+0x29/0x170 include/linux/local_lock_internal.h:29 __mmap_lock_do_trace_acquire_returned+0x7c/0x340 mm/mmap_lock.c:237 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline] mmap_read_trylock include/linux/mmap_lock.h:137 [inline] stack_map_get_build_id_offset+0x612/0x930 kernel/bpf/stackmap.c:185 __bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:496 ____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1490 [inline] bpf_get_stack_raw_tp+0x1b2/0x220 kernel/trace/bpf_trace.c:1480 bpf_prog_ec3b2eefa702d8d3+0x3a/0x674 bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline] __bpf_prog_run include/linux/filter.h:628 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline] bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1917 trace_tlb_flush+0xed/0x110 include/trace/events/tlb.h:38 switch_mm_irqs_off+0x748/0xa30 context_switch kernel/sched/core.c:5016 [inline] __schedule+0x1167/0x45b0 kernel/sched/core.c:6376 preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6780 irqentry_exit+0x53/0x80 kernel/entry/common.c:432 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:638 __pmd_alloc+0x34b/0x850 mm/memory.c:4929 pmd_alloc include/linux/mm.h:2180 [inline] copy_pmd_range mm/memory.c:1136 [inline] copy_pud_range mm/memory.c:1193 [inline] copy_p4d_range mm/memory.c:1217 [inline] copy_page_range+0x3bbc/0x43b0 mm/memory.c:1290 dup_mmap kernel/fork.c:614 [inline] dup_mm kernel/fork.c:1465 [inline] copy_mm+0xc64/0x1370 kernel/fork.c:1517 copy_process+0x1816/0x3ef0 kernel/fork.c:2206 kernel_clone+0x210/0x960 kernel/fork.c:2604 __do_sys_clone kernel/fork.c:2721 [inline] __se_sys_clone kernel/fork.c:2705 [inline] __x64_sys_clone+0x23f/0x290 kernel/fork.c:2705 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Chain exists of: lock#9 --> &p->pi_lock --> &rq->__lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&rq->__lock); lock(&p->pi_lock); lock(&rq->__lock); lock(lock#9); *** DEADLOCK *** 5 locks held by syz-executor/3568: #0: ffffffff8c9ab030 (dup_mmap_sem){.+.+}-{0:0}, at: dup_mmap kernel/fork.c:502 [inline] #0: ffffffff8c9ab030 (dup_mmap_sem){.+.+}-{0:0}, at: dup_mm kernel/fork.c:1465 [inline] #0: ffffffff8c9ab030 (dup_mmap_sem){.+.+}-{0:0}, at: copy_mm+0x223/0x1370 kernel/fork.c:1517 #1: ffff88807e3d5c28 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline] #1: ffff88807e3d5c28 (&mm->mmap_lock){++++}-{3:3}, at: dup_mmap kernel/fork.c:503 [inline] #1: ffff88807e3d5c28 (&mm->mmap_lock){++++}-{3:3}, at: dup_mm kernel/fork.c:1465 [inline] #1: ffff88807e3d5c28 (&mm->mmap_lock){++++}-{3:3}, at: copy_mm+0x242/0x1370 kernel/fork.c:1517 #2: ffff888077b08828 (&mm->mmap_lock/1){+.+.}-{3:3}, at: mmap_write_lock_nested include/linux/mmap_lock.h:78 [inline] #2: ffff888077b08828 (&mm->mmap_lock/1){+.+.}-{3:3}, at: dup_mmap kernel/fork.c:512 [inline] #2: ffff888077b08828 (&mm->mmap_lock/1){+.+.}-{3:3}, at: dup_mm kernel/fork.c:1465 [inline] #2: ffff888077b08828 (&mm->mmap_lock/1){+.+.}-{3:3}, at: copy_mm+0x35c/0x1370 kernel/fork.c:1517 #3: ffff8880b9b3a358 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:475 #4: ffffffff8c91fb20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 stack backtrace: CPU: 1 PID: 3568 Comm: syz-executor Not tainted 5.15.163-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2f8/0x3b0 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 local_lock_acquire+0x29/0x170 include/linux/local_lock_internal.h:29 __mmap_lock_do_trace_acquire_returned+0x7c/0x340 mm/mmap_lock.c:237 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline] mmap_read_trylock include/linux/mmap_lock.h:137 [inline] stack_map_get_build_id_offset+0x612/0x930 kernel/bpf/stackmap.c:185 __bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:496 ____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1490 [inline] bpf_get_stack_raw_tp+0x1b2/0x220 kernel/trace/bpf_trace.c:1480 bpf_prog_ec3b2eefa702d8d3+0x3a/0x674 bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline] __bpf_prog_run include/linux/filter.h:628 [inline] bpf_prog_run include/linux/filter.h:635 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline] bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1917 trace_tlb_flush+0xed/0x110 include/trace/events/tlb.h:38 switch_mm_irqs_off+0x748/0xa30 context_switch kernel/sched/core.c:5016 [inline] __schedule+0x1167/0x45b0 kernel/sched/core.c:6376 preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6780 irqentry_exit+0x53/0x80 kernel/entry/common.c:432 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:lowmem_page_address include/linux/mm.h:1612 [inline] RIP: 0010:pmd_alloc_one include/asm-generic/pgalloc.h:133 [inline] RIP: 0010:__pmd_alloc+0x34b/0x850 mm/memory.c:4929 Code: e8 5a ba c6 ff 4d 85 e4 75 16 e8 50 ba c6 ff eb 15 e8 49 ba c6 ff e8 a4 29 79 08 4d 85 e4 74 ea e8 3a ba c6 ff fb 4c 8b 34 24 <49> c1 e6 06 48 bb 00 00 00 00 80 08 05 00 49 8d 34 1e 31 ff e8 fc RSP: 0018:ffffc90002df74a0 EFLAGS: 00000293 RAX: ffffffff81b9a3d6 RBX: 0000000000000000 RCX: ffff8880131abb80 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc90002df75d0 R08: ffffffff81b9a3ac R09: fffffbfff1f8e02e R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000200 R13: ffff888061d9aeb0 R14: ffffea00018b8940 R15: 1ffff920005bee98 pmd_alloc include/linux/mm.h:2180 [inline] copy_pmd_range mm/memory.c:1136 [inline] copy_pud_range mm/memory.c:1193 [inline] copy_p4d_range mm/memory.c:1217 [inline] copy_page_range+0x3bbc/0x43b0 mm/memory.c:1290 dup_mmap kernel/fork.c:614 [inline] dup_mm kernel/fork.c:1465 [inline] copy_mm+0xc64/0x1370 kernel/fork.c:1517 copy_process+0x1816/0x3ef0 kernel/fork.c:2206 kernel_clone+0x210/0x960 kernel/fork.c:2604 __do_sys_clone kernel/fork.c:2721 [inline] __se_sys_clone kernel/fork.c:2705 [inline] __x64_sys_clone+0x23f/0x290 kernel/fork.c:2705 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f75a21be813 Code: Unable to access opcode bytes at RIP 0x7f75a21be7e9. RSP: 002b:00007ffed344d798 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f75a21be813 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 R10: 0000555555a2b7d0 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ---------------- Code disassembly (best guess): 0: e8 5a ba c6 ff call 0xffc6ba5f 5: 4d 85 e4 test %r12,%r12 8: 75 16 jne 0x20 a: e8 50 ba c6 ff call 0xffc6ba5f f: eb 15 jmp 0x26 11: e8 49 ba c6 ff call 0xffc6ba5f 16: e8 a4 29 79 08 call 0x87929bf 1b: 4d 85 e4 test %r12,%r12 1e: 74 ea je 0xa 20: e8 3a ba c6 ff call 0xffc6ba5f 25: fb sti 26: 4c 8b 34 24 mov (%rsp),%r14 * 2a: 49 c1 e6 06 shl $0x6,%r14 <-- trapping instruction 2e: 48 bb 00 00 00 00 80 movabs $0x5088000000000,%rbx 35: 08 05 00 38: 49 8d 34 1e lea (%r14,%rbx,1),%rsi 3c: 31 ff xor %edi,%edi 3e: e8 .byte 0xe8 3f: fc cld