====================================================== WARNING: possible circular locking dependency detected 6.1.101-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor/12448 is trying to acquire lock: ffff888012b3c598 (&p->pi_lock){-.-.}-{2:2}, at: try_to_wake_up+0xad/0x12e0 kernel/sched/core.c:4111 but task is already holding lock: ffff8880b9835e90 (lock#10){+.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff8880b9835e90 (lock#10){+.+.}-{2:2}, at: __mmap_lock_do_trace_acquire_returned+0x84/0x670 mm/mmap_lock.c:237 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (lock#10){+.+.}-{2:2}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] __mmap_lock_do_trace_acquire_returned+0x9d/0x670 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+0x99e/0x9c0 kernel/bpf/stackmap.c:144 __bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:452 ____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1877 [inline] bpf_get_stack_raw_tp+0x1b2/0x220 kernel/trace/bpf_trace.c:1867 bpf_prog_22fedb13000eacf7+0xe/0xf bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline] bpf_trace_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312 trace_tlb_flush+0x151/0x1a0 include/trace/events/tlb.h:38 switch_mm_irqs_off+0x84a/0xc20 context_switch kernel/sched/core.c:5229 [inline] __schedule+0x1152/0x4570 kernel/sched/core.c:6561 schedule+0xbf/0x180 kernel/sched/core.c:6637 do_nanosleep+0x192/0x5f0 kernel/time/hrtimer.c:2045 hrtimer_nanosleep+0x24d/0x490 kernel/time/hrtimer.c:2098 __do_sys_clock_nanosleep kernel/time/posix-timers.c:1308 [inline] __se_sys_clock_nanosleep+0x323/0x3b0 kernel/time/posix-timers.c:1285 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #1 (&rq->__lock){-.-.}-{2:2}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 _raw_spin_lock_nested+0x2d/0x40 kernel/locking/spinlock.c:378 raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537 raw_spin_rq_lock kernel/sched/sched.h:1355 [inline] rq_lock kernel/sched/sched.h:1645 [inline] task_fork_fair+0x5d/0x350 kernel/sched/fair.c:11878 sched_cgroup_fork+0x374/0x400 kernel/sched/core.c:4685 copy_process+0x2442/0x4060 kernel/fork.c:2384 kernel_clone+0x222/0x920 kernel/fork.c:2682 user_mode_thread+0x12e/0x190 kernel/fork.c:2758 rest_init+0x23/0x300 init/main.c:698 start_kernel+0x0/0x53f init/main.c:893 start_kernel+0x496/0x53f init/main.c:1140 secondary_startup_64_no_verify+0xcf/0xdb -> #0 (&p->pi_lock){-.-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __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+0xad/0x12e0 kernel/sched/core.c:4111 rcu_read_unlock_special+0x3d2/0x540 kernel/rcu/tree_plugin.h:655 __rcu_read_unlock+0x92/0x100 kernel/rcu/tree_plugin.h:426 rcu_read_unlock include/linux/rcupdate.h:823 [inline] get_memcg_path_buf mm/mmap_lock.c:142 [inline] get_mm_memcg_path+0x316/0x600 mm/mmap_lock.c:209 __mmap_lock_do_trace_acquire_returned+0x12f/0x670 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] get_mmap_lock_carefully mm/memory.c:5304 [inline] lock_mm_and_find_vma+0x219/0x2e0 mm/memory.c:5366 do_user_addr_fault arch/x86/mm/fault.c:1312 [inline] handle_page_fault arch/x86/mm/fault.c:1431 [inline] exc_page_fault+0x169/0x620 arch/x86/mm/fault.c:1487 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 __put_user_nocheck_4+0x3/0x11 schedule_tail+0x91/0xb0 kernel/sched/core.c:5183 ret_from_fork+0x8/0x30 arch/x86/entry/entry_64.S:280 other info that might help us debug this: Chain exists of: &p->pi_lock --> &rq->__lock --> lock#10 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(lock#10); lock(&rq->__lock); lock(lock#10); lock(&p->pi_lock); *** DEADLOCK *** 3 locks held by syz-executor/12448: #0: ffff88801f375b58 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff88801f375b58 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5304 [inline] #0: ffff88801f375b58 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x2e/0x2e0 mm/memory.c:5366 #1: ffff8880b9835e90 (lock#10){+.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] #1: ffff8880b9835e90 (lock#10){+.+.}-{2:2}, at: __mmap_lock_do_trace_acquire_returned+0x84/0x670 mm/mmap_lock.c:237 #2: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #2: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #2: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: get_memcg_path_buf mm/mmap_lock.c:139 [inline] #2: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: get_mm_memcg_path+0xb1/0x600 mm/mmap_lock.c:209 stack backtrace: CPU: 0 PID: 12448 Comm: syz-executor Not tainted 6.1.101-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/0x2cb lib/dump_stack.c:106 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __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+0xad/0x12e0 kernel/sched/core.c:4111 rcu_read_unlock_special+0x3d2/0x540 kernel/rcu/tree_plugin.h:655 __rcu_read_unlock+0x92/0x100 kernel/rcu/tree_plugin.h:426 rcu_read_unlock include/linux/rcupdate.h:823 [inline] get_memcg_path_buf mm/mmap_lock.c:142 [inline] get_mm_memcg_path+0x316/0x600 mm/mmap_lock.c:209 __mmap_lock_do_trace_acquire_returned+0x12f/0x670 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] get_mmap_lock_carefully mm/memory.c:5304 [inline] lock_mm_and_find_vma+0x219/0x2e0 mm/memory.c:5366 do_user_addr_fault arch/x86/mm/fault.c:1312 [inline] handle_page_fault arch/x86/mm/fault.c:1431 [inline] exc_page_fault+0x169/0x620 arch/x86/mm/fault.c:1487 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0010:__put_user_nocheck_4+0x3/0x11 Code: 00 00 48 39 d9 73 54 0f 01 cb 66 89 01 31 c9 0f 01 ca c3 0f 1f 44 00 00 48 bb fd ef ff ff ff 7f 00 00 48 39 d9 73 34 0f 01 cb <89> 01 31 c9 0f 01 ca c3 66 0f 1f 44 00 00 48 bb f9 ef ff ff ff 7f RSP: 0018:ffffc900038eff28 EFLAGS: 00050293 RAX: 0000000000000114 RBX: 00007fffffffeffd RCX: 00005555574a27d0 RDX: 0000000000000000 RSI: ffffffff8b0c13c0 RDI: ffffffff8b5d5b60 RBP: ffff888026920690 R08: dffffc0000000000 R09: fffffbfff1d3379e R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000114 R15: dffffc0000000000 schedule_tail+0x91/0xb0 kernel/sched/core.c:5183 ret_from_fork+0x8/0x30 arch/x86/entry/entry_64.S:280 ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: 48 39 d9 cmp %rbx,%rcx 5: 73 54 jae 0x5b 7: 0f 01 cb stac a: 66 89 01 mov %ax,(%rcx) d: 31 c9 xor %ecx,%ecx f: 0f 01 ca clac 12: c3 ret 13: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 18: 48 bb fd ef ff ff ff movabs $0x7fffffffeffd,%rbx 1f: 7f 00 00 22: 48 39 d9 cmp %rbx,%rcx 25: 73 34 jae 0x5b 27: 0f 01 cb stac * 2a: 89 01 mov %eax,(%rcx) <-- trapping instruction 2c: 31 c9 xor %ecx,%ecx 2e: 0f 01 ca clac 31: c3 ret 32: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 38: 48 rex.W 39: bb f9 ef ff ff mov $0xffffeff9,%ebx 3e: ff (bad) 3f: 7f .byte 0x7f