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

Zhao Gongyi zhaogongyi at bytedance.com
Mon Nov 2 00:45:35 PST 2026


Hi Jinjie,


On 11/2/26 3:54 PM, Jinjie Ruan wrote:
> 
> I think maybe we can refer to ptrace_get_syscall_info_op()?
> 

Thanks for the suggestion.

I checked ptrace_get_syscall_info_op(). It is currently static to
kernel/ptrace.c and identifies a syscall stop only when
last_siginfo->si_code is SIGTRAP | 0x80.

The arm64 path here also needs to handle a syscall-exit-stop when the
tracer has not enabled PTRACE_O_TRACESYSGOOD. In that case, the tested
si_code is plain SIGTRAP. Reusing the current logic from
ptrace_get_syscall_info_op() would therefore fail to recognize that
syscall-exit-stop and could update orig_x0 from x0, which contains the
syscall return value at that point.

We could refactor the generic helper and consider recognizing plain
SIGTRAP there as well, but that would broaden this fix and potentially
change the behavior of PTRACE_GET_SYSCALL_INFO. For this patch, I think
the local check of last_siginfo, with bit 0x80 masked and ptrace_message 
checked for PTRACE_EVENTMSG_SYSCALL_EXIT, is the smaller and safer change.

Thanks,
Gongyi



More information about the linux-arm-kernel mailing list