mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jinjie Ruan <ruanjinjie@huawei.com>
To: Kees Cook <kees@kernel.org>
Cc: <catalin.marinas@arm.com>, <will@kernel.org>,
	<mark.rutland@arm.com>, <oleg@redhat.com>, <luto@amacapital.net>,
	<wad@chromium.org>, <peterz@infradead.org>,
	<ada.coupriediaz@arm.com>, <linusw@kernel.org>,
	<yeoreum.yun@arm.com>, <kevin.brodsky@arm.com>,
	<anshuman.khandual@arm.com>, <james.morse@arm.com>,
	<thuth@redhat.com>, <vladimir.murzin@arm.com>, <tglx@kernel.org>,
	<broonie@kernel.org>, <liqiang01@kylinos.cn>,
	<ryan.roberts@arm.com>, <pengcan@kylinos.cn>,
	<kmehltretter@gmail.com>, <linux-arm-kernel@lists.infradead.org>,
	Shuah Khan <shuah@kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-kselftest@vger.kernel.org>,
	<linux-hardening@vger.kernel.org>
Subject: Re: [PATCH] selftests/ptrace: Add PTRACE_SYSEMU_SINGLESTEP syscall-exit-stop test
Date: Mon, 28 Sep 2026 09:58:59 +0800	[thread overview]
Message-ID: <a8a8edfd-0f01-4a30-9876-a9eab172eb0e@huawei.com> (raw)
In-Reply-To: <202609241654.F545D3A88@keescook>



在 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


      reply	other threads:[~2026-09-28  1:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22 19:57 Kees Cook
2026-09-23 11:07 ` Oleg Nesterov
2026-09-24  4:11 ` Jinjie Ruan
2026-09-24 23:56   ` Kees Cook
2026-09-28  1:58     ` Jinjie Ruan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a8a8edfd-0f01-4a30-9876-a9eab172eb0e@huawei.com \
    --to=ruanjinjie@huawei.com \
    --cc=ada.coupriediaz@arm.com \
    --cc=anshuman.khandual@arm.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=kees@kernel.org \
    --cc=kevin.brodsky@arm.com \
    --cc=kmehltretter@gmail.com \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=liqiang01@kylinos.cn \
    --cc=luto@amacapital.net \
    --cc=mark.rutland@arm.com \
    --cc=oleg@redhat.com \
    --cc=pengcan@kylinos.cn \
    --cc=peterz@infradead.org \
    --cc=ryan.roberts@arm.com \
    --cc=shuah@kernel.org \
    --cc=tglx@kernel.org \
    --cc=thuth@redhat.com \
    --cc=vladimir.murzin@arm.com \
    --cc=wad@chromium.org \
    --cc=will@kernel.org \
    --cc=yeoreum.yun@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®