====================================================== WARNING: possible circular locking dependency detected 5.15.164-syzkaller #0 Not tainted ------------------------------------------------------ dhcpcd/3790 is trying to acquire lock: ffff888012a20a28 (&p->pi_lock){-.-.}-{2:2}, at: try_to_wake_up+0xae/0x1300 kernel/sched/core.c:4030 but task is already holding lock: ffff8880b9b35bb8 (lock#9){+.+.}-{2:2}, at: local_lock_acquire+0xd/0x170 include/linux/local_lock_internal.h:28 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (lock#9){+.+.}-{2:2}: 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/0x878 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 schedule+0x11b/0x1f0 kernel/sched/core.c:6459 syslog_print+0x2a1/0x9b0 kernel/printk/printk.c:1526 do_syslog+0x842/0x940 kernel/printk/printk.c:1679 __do_sys_syslog kernel/printk/printk.c:1771 [inline] __se_sys_syslog kernel/printk/printk.c:1769 [inline] __x64_sys_syslog+0x78/0x90 kernel/printk/printk.c:1769 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 -> #1 (&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 -> #0 (&p->pi_lock){-.-.}-{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 __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] put_memcg_path_buf+0xde/0x100 mm/mmap_lock.c:153 __mmap_lock_do_trace_acquire_returned+0x12f/0x340 mm/mmap_lock.c:237 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline] mmap_read_lock include/linux/mmap_lock.h:118 [inline] exec_mmap+0x604/0x630 fs/exec.c:1002 begin_new_exec+0x75d/0x1030 fs/exec.c:1295 load_elf_binary+0x945/0x2750 fs/binfmt_elf.c:1001 search_binary_handler fs/exec.c:1738 [inline] exec_binprm fs/exec.c:1779 [inline] bprm_execve+0x8fd/0x17c0 fs/exec.c:1848 do_execveat_common+0x583/0x720 fs/exec.c:1953 do_execve fs/exec.c:2023 [inline] __do_sys_execve fs/exec.c:2099 [inline] __se_sys_execve fs/exec.c:2094 [inline] __x64_sys_execve+0x8e/0xa0 fs/exec.c:2094 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: &p->pi_lock --> &rq->__lock --> lock#9 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(lock#9); lock(&rq->__lock); lock(lock#9); lock(&p->pi_lock); *** DEADLOCK *** 5 locks held by dhcpcd/3790: #0: ffff88801da26040 (&sig->cred_guard_mutex){+.+.}-{3:3}, at: prepare_bprm_creds fs/exec.c:1481 [inline] #0: ffff88801da26040 (&sig->cred_guard_mutex){+.+.}-{3:3}, at: bprm_execve+0xc8/0x17c0 fs/exec.c:1816 #1: ffff88801da260d8 (&sig->exec_update_lock){+.+.}-{3:3}, at: exec_mmap+0xf0/0x630 fs/exec.c:991 #2: ffff888019799d28 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock include/linux/mmap_lock.h:117 [inline] #2: ffff888019799d28 (&mm->mmap_lock){++++}-{3:3}, at: exec_mmap+0x175/0x630 fs/exec.c:1002 #3: ffff8880b9b35bb8 (lock#9){+.+.}-{2:2}, at: local_lock_acquire+0xd/0x170 include/linux/local_lock_internal.h:28 #4: ffffffff8c91fb20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 stack backtrace: CPU: 1 PID: 3790 Comm: dhcpcd Not tainted 5.15.164-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 __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] put_memcg_path_buf+0xde/0x100 mm/mmap_lock.c:153 __mmap_lock_do_trace_acquire_returned+0x12f/0x340 mm/mmap_lock.c:237 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline] mmap_read_lock include/linux/mmap_lock.h:118 [inline] exec_mmap+0x604/0x630 fs/exec.c:1002 begin_new_exec+0x75d/0x1030 fs/exec.c:1295 load_elf_binary+0x945/0x2750 fs/binfmt_elf.c:1001 search_binary_handler fs/exec.c:1738 [inline] exec_binprm fs/exec.c:1779 [inline] bprm_execve+0x8fd/0x17c0 fs/exec.c:1848 do_execveat_common+0x583/0x720 fs/exec.c:1953 do_execve fs/exec.c:2023 [inline] __do_sys_execve fs/exec.c:2099 [inline] __se_sys_execve fs/exec.c:2094 [inline] __x64_sys_execve+0x8e/0xa0 fs/exec.c:2094 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:0x7fc0aa4a6ef7 Code: ba 0f 00 5b 5d 41 5c 41 5d 41 5e 41 5f e9 63 d8 fb ff 48 83 c4 18 5b 5d 41 5c 41 5d 41 5e 41 5f c3 66 90 b8 3b 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 01 3f 0f 00 f7 d8 64 89 01 48 RSP: 002b:00007fc0aa350e78 EFLAGS: 00000246 ORIG_RAX: 000000000000003b RAX: ffffffffffffffda RBX: 00007ffd50386c50 RCX: 00007fc0aa4a6ef7 RDX: 000055e376e9c400 RSI: 00007ffd50387140 RDI: 000055e37570cdf6 RBP: 00007fc0aa350ff0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000008 R11: 0000000000000246 R12: 00007ffd50386f68 R13: 00007fc0aa350f28 R14: 0000000000000000 R15: 0000000000000041