====================================================== WARNING: possible circular locking dependency detected 6.1.93-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/5718 is trying to acquire lock: ffff888058e0c0d8 (&sighand->siglock){-.-.}-{2:2}, at: __lock_task_sighand+0x145/0x2d0 kernel/signal.c:1410 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: -> #3 (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 0xffffffffa0000b82 bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline] __bpf_prog_run include/linux/filter.h:596 [inline] bpf_prog_run include/linux/filter.h:610 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline] bpf_trace_run2+0x361/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:5230 [inline] __schedule+0x1140/0x4550 kernel/sched/core.c:6558 preempt_schedule_common+0x83/0xd0 kernel/sched/core.c:6727 preempt_schedule+0xd9/0xe0 kernel/sched/core.c:6751 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+0x153/0x940 arch/x86/kernel/alternative.c:1531 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:3372 bpf_raw_tracepoint_open+0x196/0x210 kernel/bpf/syscall.c:3399 __sys_bpf+0x4a7/0x6c0 kernel/bpf/syscall.c:5047 __do_sys_bpf kernel/bpf/syscall.c:5109 [inline] __se_sys_bpf kernel/bpf/syscall.c:5107 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5107 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 -> #2 (&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:1354 [inline] rq_lock kernel/sched/sched.h:1644 [inline] task_fork_fair+0x5d/0x350 kernel/sched/fair.c:11884 sched_cgroup_fork+0x374/0x400 kernel/sched/core.c:4686 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:699 start_kernel+0x0/0x53f init/main.c:894 start_kernel+0x496/0x53f init/main.c:1141 secondary_startup_64_no_verify+0xcf/0xdb -> #1 (&p->pi_lock){-.-.}-{2:2}: 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:4112 signal_wake_up_state kernel/signal.c:780 [inline] signal_wake_up include/linux/sched/signal.h:457 [inline] complete_signal+0x796/0xbd0 kernel/signal.c:1074 __send_signal_locked+0xb1a/0xdc0 kernel/signal.c:1194 do_notify_parent+0xe2b/0x1100 kernel/signal.c:2120 exit_notify kernel/exit.c:744 [inline] do_exit+0x172e/0x26a0 kernel/exit.c:889 do_group_exit+0x202/0x2b0 kernel/exit.c:1019 __do_sys_exit_group kernel/exit.c:1030 [inline] __se_sys_exit_group kernel/exit.c:1028 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1028 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 -> #0 (&sighand->siglock){-.-.}-{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 __lock_task_sighand+0x145/0x2d0 kernel/signal.c:1410 lock_task_sighand include/linux/sched/signal.h:745 [inline] do_send_sig_info kernel/signal.c:1299 [inline] group_send_sig_info+0x26c/0x300 kernel/signal.c:1448 bpf_send_signal_common+0x2d8/0x420 kernel/trace/bpf_trace.c:882 ____bpf_send_signal kernel/trace/bpf_trace.c:887 [inline] bpf_send_signal+0x15/0x20 kernel/trace/bpf_trace.c:885 bpf_prog_9fbc3d1d47c9b36c+0x1a/0x21 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_run4+0x253/0x470 kernel/trace/bpf_trace.c:2314 trace_mmap_lock_acquire_returned include/trace/events/mmap_lock.h:52 [inline] __mmap_lock_do_trace_acquire_returned+0x5e3/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_8+0x3/0x21 clear_rseq_cs kernel/rseq.c:228 [inline] rseq_ip_fixup kernel/rseq.c:262 [inline] __rseq_handle_notify_resume+0x5e6/0x1500 kernel/rseq.c:300 rseq_handle_notify_resume include/linux/sched.h:2329 [inline] resume_user_mode_work include/linux/resume_user_mode.h:61 [inline] exit_to_user_mode_loop+0xb4/0x100 kernel/entry/common.c:177 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: &sighand->siglock --> &rq->__lock --> lock#10 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(lock#10); lock(&rq->__lock); lock(lock#10); lock(&sighand->siglock); *** DEADLOCK *** 5 locks held by syz-executor.4/5718: #0: ffff88807b8b8158 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff88807b8b8158 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5304 [inline] #0: ffff88807b8b8158 (&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: ffffffff8d12acc0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #2: ffffffff8d12acc0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #2: ffffffff8d12acc0 (rcu_read_lock){....}-{1:2}, at: get_memcg_path_buf mm/mmap_lock.c:139 [inline] #2: ffffffff8d12acc0 (rcu_read_lock){....}-{1:2}, at: get_mm_memcg_path+0xb1/0x600 mm/mmap_lock.c:209 #3: ffffffff8d12acc0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #3: ffffffff8d12acc0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #3: ffffffff8d12acc0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline] #3: ffffffff8d12acc0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run4+0x16a/0x470 kernel/trace/bpf_trace.c:2314 #4: ffffffff8d12acc0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #4: ffffffff8d12acc0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #4: ffffffff8d12acc0 (rcu_read_lock){....}-{1:2}, at: __lock_task_sighand+0x25/0x2d0 kernel/signal.c:1393 stack backtrace: CPU: 0 PID: 5718 Comm: syz-executor.4 Not tainted 6.1.93-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/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 __lock_task_sighand+0x145/0x2d0 kernel/signal.c:1410 lock_task_sighand include/linux/sched/signal.h:745 [inline] do_send_sig_info kernel/signal.c:1299 [inline] group_send_sig_info+0x26c/0x300 kernel/signal.c:1448 bpf_send_signal_common+0x2d8/0x420 kernel/trace/bpf_trace.c:882 ____bpf_send_signal kernel/trace/bpf_trace.c:887 [inline] bpf_send_signal+0x15/0x20 kernel/trace/bpf_trace.c:885 bpf_prog_9fbc3d1d47c9b36c+0x1a/0x21 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_run4+0x253/0x470 kernel/trace/bpf_trace.c:2314 trace_mmap_lock_acquire_returned include/trace/events/mmap_lock.h:52 [inline] __mmap_lock_do_trace_acquire_returned+0x5e3/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_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:ffffc900137cfd78 EFLAGS: 00050297 RAX: 0000000000000000 RBX: 00007fffffffeff9 RCX: 0000555555e77da8 RDX: 0000000000000000 RSI: ffffffff8aec13c0 RDI: ffffffff8b3d4520 RBP: ffffc900137cfea8 R08: dffffc0000000000 R09: fffffbfff1ce7246 R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc900137cfe28 R13: dffffc0000000000 R14: 1ffff920026f9ffb R15: 0000000000000000 clear_rseq_cs kernel/rseq.c:228 [inline] rseq_ip_fixup kernel/rseq.c:262 [inline] __rseq_handle_notify_resume+0x5e6/0x1500 kernel/rseq.c:300 rseq_handle_notify_resume include/linux/sched.h:2329 [inline] resume_user_mode_work include/linux/resume_user_mode.h:61 [inline] exit_to_user_mode_loop+0xb4/0x100 kernel/entry/common.c:177 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:0x7f1dfc279ed3 Code: 1f 84 00 00 00 00 00 64 48 8b 04 25 10 00 00 00 45 31 c0 31 d2 31 f6 bf 11 00 20 01 4c 8d 90 d0 02 00 00 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 89 c2 85 c0 75 2c 64 48 8b 04 25 10 00 00 RSP: 002b:00007ffd8e5df688 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: 000000000000037b RBX: 0000000000000000 RCX: 00007f1dfc279ed3 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 R10: 0000555555e77750 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 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