[PATCH v3] arm64: ptrace: don't warn on missing siginfo in a group-stop
From: Zhao Gongyi
Date: Thu Nov 05 2026 - 06:31:28 EST
PTRACE_ATTACH to a group-stopped child can enter do_jobctl_trap(),
which calls ptrace_stop() without siginfo. If the tracer writes
NT_ARM_SYSTEM_CALL, system_call_set() can change syscallno from
NO_SYSCALL before update_syscall_orig_x0_after_ptrace() checks
last_siginfo. WARN_ON_ONCE(!info) then fires for a valid ptrace stop.
Keep the early return when siginfo is absent, but remove the warning.
This leaves orig_x0 untouched at a non-seized group-stop and preserves
the existing syscall-exit-stop handling.
Fixes: 88b839ce497c ("arm64: ptrace: Keep 'orig_x0' in-sync with x0 on syscall entry")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Zhao Gongyi <zhaogongyi@xxxxxxxxxxxxx>
---
Changes since v2:
- Keep the early return on missing siginfo, as requested by Will.
- Remove v2's NULL guard on the syscall-exit-stop check, which is no
longer needed after the early return.
- Update the comment to describe the non-seized group-stop case.
v2: https://lore.kernel.org/r/20261023110710.10145-1-zhaogongyi@xxxxxxxxxxxxx
A local early-return variant was exercised on arm64 KVM with a non-seized
PTRACE_ATTACH group-stop and an NT_ARM_SYSTEM_CALL write. The write
succeeded without a kernel warning. Additional signal-handling probes
compared this behavior with v2; neither kernel reported a warning,
BUG, KASAN issue, or panic.
arch/arm64/kernel/ptrace.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index f743cbe..ecaa09b 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -573,8 +573,8 @@ static void update_syscall_orig_x0_after_ptrace(struct task_struct *target)
if (regs->syscallno == NO_SYSCALL)
return;
- /* We should only be called when target is in a ptrace stop */
- if (WARN_ON_ONCE(!info))
+ /* Non-seized group-stops do not provide siginfo (see do_jobctl_trap()). */
+ if (!info)
return;
/*
base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
--
2.39.5 (Apple Git-154)