====================================================== WARNING: possible circular locking dependency detected 6.1.102-syzkaller #0 Not tainted ------------------------------------------------------ syz.1.409/5282 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#11){+.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff8880b9835e90 (lock#11){+.+.}-{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#11){+.+.}-{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 0xffffffffa0001fd2 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 preempt_schedule_common+0x83/0xd0 kernel/sched/core.c:6730 preempt_schedule+0xd9/0xe0 kernel/sched/core.c:6754 preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:34 __raw_spin_unlock include/linux/spinlock_api_smp.h:143 [inline] _raw_spin_unlock+0x36/0x40 kernel/locking/spinlock.c:186 spin_unlock include/linux/spinlock.h:391 [inline] __text_poke+0x81a/0x9a0 arch/x86/kernel/alternative.c:1216 text_poke arch/x86/kernel/alternative.c:1240 [inline] text_poke_bp_batch+0x481/0x940 arch/x86/kernel/alternative.c:1556 text_poke_flush arch/x86/kernel/alternative.c:1725 [inline] text_poke_finish+0x16/0x30 arch/x86/kernel/alternative.c:1732 arch_jump_label_transform_apply+0x13/0x20 arch/x86/kernel/jump_label.c:146 static_key_enable_cpuslocked+0x12e/0x250 kernel/jump_label.c:177 static_key_enable+0x16/0x20 kernel/jump_label.c:190 tracepoint_add_func+0x947/0x9d0 kernel/tracepoint.c:361 tracepoint_probe_register_prio_may_exist+0x11e/0x190 kernel/tracepoint.c:482 bpf_raw_tp_link_attach+0x456/0x6b0 kernel/bpf/syscall.c:3387 bpf_raw_tracepoint_open+0x196/0x210 kernel/bpf/syscall.c:3414 __sys_bpf+0x4a7/0x6c0 kernel/bpf/syscall.c:5062 __do_sys_bpf kernel/bpf/syscall.c:5124 [inline] __se_sys_bpf kernel/bpf/syscall.c:5122 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5122 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_mem_cgroup_from_mm+0x19f/0x290 mm/memcontrol.c:1042 get_mm_memcg_path+0x1b/0x600 mm/mmap_lock.c:202 __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_write_lock include/linux/mmap_lock.h:72 [inline] exit_mmap+0x85d/0x9f0 mm/mmap.c:3235 __mmput+0x115/0x3c0 kernel/fork.c:1199 exit_mm+0x226/0x300 kernel/exit.c:565 do_exit+0x9f6/0x26a0 kernel/exit.c:858 do_group_exit+0x202/0x2b0 kernel/exit.c:1021 get_signal+0x16f7/0x17d0 kernel/signal.c:2862 arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline] syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:303 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:87 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Chain exists of: &p->pi_lock --> &rq->__lock --> lock#11 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(lock#11); lock(&rq->__lock); lock(lock#11); lock(&p->pi_lock); *** DEADLOCK *** 3 locks held by syz.1.409/5282: #0: ffff88801286db58 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock include/linux/mmap_lock.h:71 [inline] #0: ffff88801286db58 (&mm->mmap_lock){++++}-{3:3}, at: exit_mmap+0x29a/0x9f0 mm/mmap.c:3235 #1: ffff8880b9835e90 (lock#11){+.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] #1: ffff8880b9835e90 (lock#11){+.+.}-{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_mem_cgroup_from_mm+0x34/0x290 mm/memcontrol.c:1036 stack backtrace: CPU: 0 PID: 5282 Comm: syz.1.409 Not tainted 6.1.102-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_mem_cgroup_from_mm+0x19f/0x290 mm/memcontrol.c:1042 get_mm_memcg_path+0x1b/0x600 mm/mmap_lock.c:202 __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_write_lock include/linux/mmap_lock.h:72 [inline] exit_mmap+0x85d/0x9f0 mm/mmap.c:3235 __mmput+0x115/0x3c0 kernel/fork.c:1199 exit_mm+0x226/0x300 kernel/exit.c:565 do_exit+0x9f6/0x26a0 kernel/exit.c:858 do_group_exit+0x202/0x2b0 kernel/exit.c:1021 get_signal+0x16f7/0x17d0 kernel/signal.c:2862 arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline] syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:303 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:87 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f2eda9773b9 Code: Unable to access opcode bytes at 0x7f2eda97738f. RSP: 002b:00007f2edb7ab0f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007f2edab06138 RCX: 00007f2eda9773b9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f2edab06138 RBP: 00007f2edab06130 R08: 00007f2edb7ab6c0 R09: 00007f2edb7ab6c0 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f2edab0613c R13: 000000000000006e R14: 00007ffdf28528c0 R15: 00007ffdf28529a8