====================================================== WARNING: possible circular locking dependency detected 6.10.0-syzkaller-04472-g51835949dda3 #0 Not tainted ------------------------------------------------------ cmp/7419 is trying to acquire lock: ffff888015fb8a18 (&p->pi_lock){-.-.}-{2:2}, at: class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:551 [inline] ffff888015fb8a18 (&p->pi_lock){-.-.}-{2:2}, at: try_to_wake_up+0x9a/0x13e0 kernel/sched/core.c:4051 but task is already holding lock: ffff88802c038aa0 (lock#14){+.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff88802c038aa0 (lock#14){+.+.}-{2:2}, at: __mmap_lock_do_trace_acquire_returned+0x7f/0x790 mm/mmap_lock.c:237 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (lock#14){+.+.}-{2:2}: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] __mmap_lock_do_trace_acquire_returned+0x97/0x790 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:164 [inline] stack_map_get_build_id_offset+0x602/0x760 kernel/bpf/stackmap.c:141 __bpf_get_stack+0x68a/0x710 kernel/bpf/stackmap.c:449 ____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1997 [inline] bpf_get_stack_raw_tp+0x124/0x160 kernel/trace/bpf_trace.c:1987 bpf_prog_ec3b2eefa702d8d3+0x42/0x46 bpf_dispatcher_nop_func include/linux/bpf.h:1243 [inline] __bpf_prog_run include/linux/filter.h:691 [inline] bpf_prog_run include/linux/filter.h:698 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2406 [inline] bpf_trace_run2+0x231/0x590 kernel/trace/bpf_trace.c:2447 trace_tlb_flush+0xf3/0x170 include/trace/events/tlb.h:38 switch_mm_irqs_off+0x68b/0xbc0 arch/x86/mm/tlb.c:642 context_switch kernel/sched/core.c:5172 [inline] __schedule+0xc4d/0x5490 kernel/sched/core.c:6529 __schedule_loop kernel/sched/core.c:6606 [inline] schedule+0xe7/0x350 kernel/sched/core.c:6621 futex_wait_queue+0xfc/0x1f0 kernel/futex/waitwake.c:370 __futex_wait+0x291/0x3c0 kernel/futex/waitwake.c:669 futex_wait+0xe9/0x380 kernel/futex/waitwake.c:697 do_futex+0x22b/0x350 kernel/futex/syscalls.c:102 __do_sys_futex_time32 kernel/futex/syscalls.c:509 [inline] __se_sys_futex_time32 kernel/futex/syscalls.c:492 [inline] __ia32_sys_futex_time32+0x1da/0x460 kernel/futex/syscalls.c:492 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #1 (&rq->__lock){-.-.}-{2:2}: _raw_spin_lock_nested+0x31/0x40 kernel/locking/spinlock.c:378 raw_spin_rq_lock_nested+0x29/0x130 kernel/sched/core.c:560 raw_spin_rq_lock kernel/sched/sched.h:1415 [inline] rq_lock kernel/sched/sched.h:1714 [inline] task_fork_fair+0x73/0x250 kernel/sched/fair.c:12710 sched_cgroup_fork+0x3cf/0x510 kernel/sched/core.c:4633 copy_process+0x4710/0x6f50 kernel/fork.c:2482 kernel_clone+0xfd/0x980 kernel/fork.c:2780 user_mode_thread+0xb4/0xf0 kernel/fork.c:2858 rest_init+0x23/0x2b0 init/main.c:712 start_kernel+0x3df/0x4c0 init/main.c:1103 x86_64_start_reservations+0x18/0x30 arch/x86/kernel/head64.c:507 x86_64_start_kernel+0xb2/0xc0 arch/x86/kernel/head64.c:488 common_startup_64+0x13e/0x148 -> #0 (&p->pi_lock){-.-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3133 [inline] check_prevs_add kernel/locking/lockdep.c:3252 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5136 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5718 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:551 [inline] try_to_wake_up+0x9a/0x13e0 kernel/sched/core.c:4051 rcu_read_unlock_special kernel/rcu/tree_plugin.h:665 [inline] __rcu_read_unlock+0x24c/0x580 kernel/rcu/tree_plugin.h:436 rcu_read_unlock include/linux/rcupdate.h:872 [inline] put_memcg_path_buf mm/mmap_lock.c:153 [inline] __mmap_lock_do_trace_acquire_returned+0x262/0x790 mm/mmap_lock.c:237 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline] mmap_write_lock_killable include/linux/mmap_lock.h:123 [inline] vm_mmap_pgoff+0x2be/0x360 mm/util.c:576 ksys_mmap_pgoff+0x332/0x5d0 mm/mmap.c:1443 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:79 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:79 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &p->pi_lock --> &rq->__lock --> lock#14 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(lock#14); lock(&rq->__lock); lock(lock#14); lock(&p->pi_lock); *** DEADLOCK *** 2 locks held by cmp/7419: #0: ffff888011f9c418 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:122 [inline] #0: ffff888011f9c418 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x160/0x360 mm/util.c:576 #1: ffff88802c038aa0 (lock#14){+.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] #1: ffff88802c038aa0 (lock#14){+.+.}-{2:2}, at: __mmap_lock_do_trace_acquire_returned+0x7f/0x790 mm/mmap_lock.c:237 stack backtrace: CPU: 0 PID: 7419 Comm: cmp Not tainted 6.10.0-syzkaller-04472-g51835949dda3 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2186 check_prev_add kernel/locking/lockdep.c:3133 [inline] check_prevs_add kernel/locking/lockdep.c:3252 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5136 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5718 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:551 [inline] try_to_wake_up+0x9a/0x13e0 kernel/sched/core.c:4051 rcu_read_unlock_special kernel/rcu/tree_plugin.h:665 [inline] __rcu_read_unlock+0x24c/0x580 kernel/rcu/tree_plugin.h:436 rcu_read_unlock include/linux/rcupdate.h:872 [inline] put_memcg_path_buf mm/mmap_lock.c:153 [inline] __mmap_lock_do_trace_acquire_returned+0x262/0x790 mm/mmap_lock.c:237 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline] mmap_write_lock_killable include/linux/mmap_lock.h:123 [inline] vm_mmap_pgoff+0x2be/0x360 mm/util.c:576 ksys_mmap_pgoff+0x332/0x5d0 mm/mmap.c:1443 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:79 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:79 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fb9d52b5b74 Code: 63 08 44 89 e8 5b 41 5c 41 5d c3 41 89 ca 41 f7 c1 ff 0f 00 00 74 0c c7 05 f5 46 01 00 16 00 00 00 eb 17 b8 09 00 00 00 0f 05 <48> 3d 00 f0 ff ff 76 0c f7 d8 89 05 dc 46 01 00 48 83 c8 ff c3 0f RSP: 002b:00007ffe3fca8738 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007ffe3fca87b0 RCX: 00007fb9d52b5b74 RDX: 0000000000000001 RSI: 0000000000025000 RDI: 00007fb9d4fc0000 RBP: 00007ffe3fca8ad0 R08: 0000000000000003 R09: 000000000002e000 R10: 0000000000000812 R11: 0000000000000246 R12: 00007fb9d5293880 R13: 00007ffe3fca8b58 R14: 000000000002d9c6 R15: 0000000000000000