Re: [PATCH] selftests/ptrace: Add PTRACE_SYSEMU_SINGLESTEP syscall-exit-stop test
From: Jinjie Ruan
Date: Sun Sep 27 2026 - 21:59:17 EST
在 2026/9/25 7:56, Kees Cook 写道:
> On Thu, Sep 24, 2026 at 12:11:31PM +0800, Jinjie Ruan wrote:
>>
>>
>> 在 2026/9/23 3:57, Kees Cook 写道:
>>> ptrace(2) states that no syscall-exit-stop occurs when a tracee is
>>> continued with PTRACE_SYSEMU or PTRACE_SYSEMU_SINGLESTEP. arm64 gated
>>> its syscall-exit report on
>>>
>>> flags & (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP)
>>
>> Hi Kees,
>>
>> The original fix description is a bit off: on arm64 there is no extra
>> syscall-exit-stop; instead, there's an additional pseudo single-step
>> injection.
>>
>> As sashiko pointed out, as commit ac2081cdc4d9 ("arm64: ptrace:
>> Consistently use pseudo-singlestep exceptions") described, for
>> PTRACE_SYSEMU_SINGLESTEP, arm64 still needs the pseudo single-step
>> because its hardware single-step state machine is fast-forwarded over
>> the SVC instruction.
>
> Ah! Okay. So this test should be tweaked to deal with that? Feel free to
Yes, I understand that these two cases should be distinguished.
> snag/update this test for the series. We didn't have anything testing
> syscall exit stops, so it seemed reasonable to get it written.
I agree with adding a syscall exit stop test case to check whether it
violates what the man page describes.
At the same time, I think we could also add a test case to verify the
problems that may arise from arm64's own missing pseudo single-step.
>
> -Kees
>
--
Best regards,
Jinjie