====================================================== WARNING: possible circular locking dependency detected 5.15.164-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor144/3564 is trying to acquire lock: ffff88813fe227e8 (&p->pi_lock){-.-.}-{2:2}, at: try_to_wake_up+0xae/0x1300 kernel/sched/core.c:4030 but task is already holding lock: ffff8880b9a35bb8 (lock#8){+.+.}-{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#8){+.+.}-{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 0xffffffffa002cd3a 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_common+0x83/0xd0 kernel/sched/core.c:6552 preempt_schedule+0xd9/0xe0 kernel/sched/core.c:6577 preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:34 __raw_spin_unlock include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock+0x36/0x40 kernel/locking/spinlock.c:186 spin_unlock include/linux/spinlock.h:403 [inline] wp_page_copy+0x10e2/0x2070 mm/memory.c:3131 handle_pte_fault mm/memory.c:4639 [inline] __handle_mm_fault mm/memory.c:4756 [inline] handle_mm_fault+0x2a3d/0x5950 mm/memory.c:4854 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 -> #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] __bpf_trace_run kernel/trace/bpf_trace.c:1881 [inline] bpf_trace_run4+0x269/0x390 kernel/trace/bpf_trace.c:1919 trace_mmap_lock_acquire_returned include/trace/events/mmap_lock.h:44 [inline] __mmap_lock_do_trace_acquire_returned+0x2d6/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 __put_user_nocheck_8+0x3/0x21 clear_rseq_cs kernel/rseq.c:220 [inline] rseq_ip_fixup kernel/rseq.c:254 [inline] __rseq_handle_notify_resume+0x605/0x1250 kernel/rseq.c:292 rseq_handle_notify_resume include/linux/sched.h:2204 [inline] tracehook_notify_resume include/linux/tracehook.h:201 [inline] exit_to_user_mode_loop+0xdc/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Chain exists of: &p->pi_lock --> &rq->__lock --> lock#8 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(lock#8); lock(&rq->__lock); lock(lock#8); lock(&p->pi_lock); *** DEADLOCK *** 3 locks held by syz-executor144/3564: #0: ffff88807e562428 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff88807e562428 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1298 [inline] #0: ffff88807e562428 (&mm->mmap_lock){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1445 [inline] #0: ffff88807e562428 (&mm->mmap_lock){++++}-{3:3}, at: exc_page_fault+0x181/0x700 arch/x86/mm/fault.c:1501 #1: ffff8880b9a35bb8 (lock#8){+.+.}-{2:2}, at: local_lock_acquire+0xd/0x170 include/linux/local_lock_internal.h:28 #2: ffffffff8c91fb20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311 stack backtrace: CPU: 0 PID: 3564 Comm: syz-executor144 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] __bpf_trace_run kernel/trace/bpf_trace.c:1881 [inline] bpf_trace_run4+0x269/0x390 kernel/trace/bpf_trace.c:1919 trace_mmap_lock_acquire_returned include/trace/events/mmap_lock.h:44 [inline] __mmap_lock_do_trace_acquire_returned+0x2d6/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 RIP: 0010:__put_user_nocheck_8+0x3/0x21 Code: 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 00 00 48 39 d9 73 14 0f 01 cb <48> 89 01 31 c9 0f 01 ca c3 0f 1f 44 00 00 0f 01 ca b9 f2 ff ff ff RSP: 0018:ffffc90002d87d78 EFLAGS: 00050297 RAX: 0000000000000000 RBX: 00007fffffffeff9 RCX: 0000555555610ca8 RDX: 0000000000000000 RSI: ffffffff8a8b3ca0 RDI: ffffffff8ad8f800 RBP: ffffc90002d87eb8 R08: dffffc0000000000 R09: fffffbfff1bd2986 R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90002d87e28 R13: dffffc0000000000 R14: 0000000000000000 R15: 1ffff920005b0fc6 clear_rseq_cs kernel/rseq.c:220 [inline] rseq_ip_fixup kernel/rseq.c:254 [inline] __rseq_handle_notify_resume+0x605/0x1250 kernel/rseq.c:292 rseq_handle_notify_resume include/linux/sched.h:2204 [inline] tracehook_notify_resume include/linux/tracehook.h:201 [inline] exit_to_user_mode_loop+0xdc/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fcf014857f3 Code: 00 00 00 00 0f 1f 00 83 ff 03 74 7b 83 ff 02 b8 fa ff ff ff 49 89 ca 0f 44 f8 80 3d 8e e8 03 00 00 74 14 b8 e6 00 00 00 0f 05 d8 c3 66 2e 0f 1f 84 00 00 00 00 00 48 83 ec 28 48 89 54 24 10 RSP: 002b:00007ffc593f1228 EFLAGS: 00000202 ORIG_RAX: 00000000000000e6 RAX: 0000000000000000 RBX: 0000000000003306 RCX: 00007fcf014857f3 RDX: 00007ffc593f1240 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000042d0a R08: 00007ffc593f80b0 R09: 0000000000000010 R10: 0000000000000000 R11: 0000000000000202 R12: 00007ffc593f127c R13: 431bde82d7b634db R14: 0000000000000001 R15: 0000000000000001 ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: 48 39 d9 cmp %rbx,%rcx 5: 73 34 jae 0x3b 7: 0f 01 cb stac a: 89 01 mov %eax,(%rcx) c: 31 c9 xor %ecx,%ecx e: 0f 01 ca clac 11: c3 ret 12: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 18: 48 bb f9 ef ff ff ff movabs $0x7fffffffeff9,%rbx 1f: 7f 00 00 22: 48 39 d9 cmp %rbx,%rcx 25: 73 14 jae 0x3b 27: 0f 01 cb stac * 2a: 48 89 01 mov %rax,(%rcx) <-- trapping instruction 2d: 31 c9 xor %ecx,%ecx 2f: 0f 01 ca clac 32: c3 ret 33: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 38: 0f 01 ca clac 3b: b9 f2 ff ff ff mov $0xfffffff2,%ecx