[PATCH v2] arm64: ptrace: don't warn on missing siginfo in a group-stop

Oleg Nesterov oleg at redhat.com
Fri Oct 23 06:24:04 PDT 2026


On 10/23, Zhao Gongyi wrote:
>
> --- a/arch/arm64/kernel/ptrace.c
> +++ b/arch/arm64/kernel/ptrace.c
> @@ -573,10 +573,6 @@ 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))
> -		return;
> -
>  	/*
>  	 * For compat tasks, orig_r0 is provided directly through GPR index
>  	 * 17.
> @@ -588,7 +584,7 @@ static void update_syscall_orig_x0_after_ptrace(struct task_struct *target)
>  	 * Don't update orig_x0 for a syscall-exit-stop, as x0 now contains the
>  	 * return value of the system call.
>  	 */
> -	if ((info->si_code & ~0x80) == SIGTRAP &&
> +	if (info && (info->si_code & ~0x80) == SIGTRAP &&
>  	    target->ptrace_message == PTRACE_EVENTMSG_SYSCALL_EXIT) {
>  		return;

LGTM, but I don't understand this arm-specific code.

And... Do we need to check target->last_siginfo at all?

ptrace_signal() -> ptrace_stop() path sets ->ptrace_message = 0.

In all other cases: if info != NULL, then .si_code == target->exit_code.
ptrace_event(event) users always use event != 0 and != 0x80.

So it seems that we can just do

	if ((target->exit_code & ~0x80) == SIGTRAP &&
	    target->ptrace_message == PTRACE_EVENTMSG_SYSCALL_EXIT)

?

I'll recheck... If I am right, perhaps it makes sense to simplify
ptrace_get_syscall_info_op().

Anyway, up to you.

Oleg.




More information about the linux-arm-kernel mailing list