mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jinjie Ruan <ruanjinjie@huawei.com>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: <catalin.marinas@arm.com>, <will@kernel.org>, <kees@kernel.org>,
	<oleg@redhat.com>, <luto@amacapital.net>, <wad@chromium.org>,
	<thuth@redhat.com>, <peterz@infradead.org>,
	<mark.rutland@arm.com>, <linusw@kernel.org>,
	<ada.coupriediaz@arm.com>, <kevin.brodsky@arm.com>,
	<yeoreum.yun@arm.com>, <anshuman.khandual@arm.com>,
	<james.morse@arm.com>, <tglx@kernel.org>, <broonie@kernel.org>,
	<pengcan@kylinos.cn>, <ryan.roberts@arm.com>,
	<liqiang01@kylinos.cn>, <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>
Subject: Re: [PATCH v17 15/15] arm64: vdso: Expose sigreturn address on vdso to the kernel
Date: Tue, 21 Jul 2026 17:23:38 +0800	[thread overview]
Message-ID: <8a1c8c38-e89b-4e22-9b46-aa53b0ed30f8@huawei.com> (raw)
In-Reply-To: <20260721104810-0a8ab042-2705-43e8-90d2-74e221f3fab5@linutronix.de>



On 7/21/2026 4:51 PM, Thomas Weißschuh wrote:
> On Tue, Jul 21, 2026 at 04:18:58PM +0800, Jinjie Ruan wrote:
>> Syscall User Dispatch (SUD) must not intercept the signal trampoline
>> code, otherwise returning from a signal with a locked selector may
>> cause infinite recursion into the signal handler.
>>
>> Provide an arm64 implementation of arch_syscall_is_vdso_sigreturn()
>> to exclude these sigreturn syscalls from dispatch.
>>
>> For native 64-bit tasks, check whether the current PC matches the 'svc #0'
>> instruction inside the vDSO sigreturn trampoline (defined in
>> arch/arm64/kernel/vdso/sigreturn.S as below).
>>
>> 	SYM_CODE_START(__kernel_rt_sigreturn)
>> 		mov     x8, #__NR_rt_sigreturn
>> 		svc     #0
>> 	SYM_CODE_END(__kernel_rt_sigreturn)
> 
> With the new label this code snippet here shouldnt be needed anymore.

You're right, the code itself is already clear.

> 
>> For COMPAT tasks, verify that the instruction falls within the dedicated
>> 'sigpage' range, since compat signal handlers use this architecture-
>> specific page (not the vDSO) for their return trampoline. This prevents
>> SUD from incorrectly dispatching syscalls issued during signal return.
>>
>> Suggested-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
>> Suggested-by: Kevin Brodsky <kevin.brodsky@arm.com>
>> Suggested-by: kemal <kmal@cock.li>
>> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
>> ---
>>  arch/arm64/Kconfig                 |  1 +
>>  arch/arm64/include/asm/elf.h       |  1 +
>>  arch/arm64/kernel/vdso.c           | 16 ++++++++++++++++
>>  arch/arm64/kernel/vdso/sigreturn.S |  1 +
>>  arch/arm64/kernel/vdso/vdso.lds.S  |  1 +
>>  5 files changed, 20 insertions(+)
>>
>> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
>> index aea686dce3d5..a41d2b593899 100644
>> --- a/arch/arm64/Kconfig
>> +++ b/arch/arm64/Kconfig
>> @@ -86,6 +86,7 @@ config ARM64
>>  	select ARCH_SUPPORTS_SCHED_SMT
>>  	select ARCH_SUPPORTS_SCHED_CLUSTER
>>  	select ARCH_SUPPORTS_SCHED_MC
>> +	select ARCH_SUPPORTS_SYSCALL_USER_DISPATCH
> 
> From the subject and description I would not have expected this to be in here.
> Split into its own patch?

If ARCH_SUPPORTS_SYSCALL_USER_DISPATCH is not implemented, then it seems
pointless to implement arch_syscall_is_vdso_sigreturn() separately, or
perhaps we should revise the title to indicate support for SUD on arm64?

> 
>>  	select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
>>  	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION if COMPAT
>>  	select ARCH_WANT_DEFAULT_BPF_JIT
> 
> (...)
> 
> For the rest:
> 
> Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>

Thanks for the review.

> 
> 
> Thomas


  reply	other threads:[~2026-07-21  9:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21  8:18 [PATCH v17 00/15] arm64: entry: Convert to Generic Entry Jinjie Ruan
2026-07-21  8:18 ` [PATCH v17 01/15] arm64: ptrace: Skip syscall exit reporting for PTRACE_SYSEMU_SINGLESTEP Jinjie Ruan
2026-07-21  8:18 ` [PATCH v17 02/15] arm64: ptrace: Rework audit_syscall_entry() Jinjie Ruan
2026-07-21  8:18 ` [PATCH v17 03/15] arm64: ptrace: Open-code seccomp check in syscall_trace_enter() Jinjie Ruan
2026-07-21  8:18 ` [PATCH v17 04/15] arm64: ptrace: Rename and clean up syscall_trace_enter() Jinjie Ruan
2026-07-21  8:39   ` Linus Walleij
2026-07-21  8:18 ` [PATCH v17 05/15] arm64: ptrace: Protect rseq_syscall() from tracer PC modifications Jinjie Ruan
2026-07-21  8:18 ` [PATCH v17 06/15] arm64: syscall: Rework the syscall exit path in el0_svc_common() Jinjie Ruan
2026-07-21  8:43   ` Linus Walleij
2026-07-21  8:45     ` Linus Walleij
2026-07-21  8:18 ` [PATCH v17 07/15] arm64: ptrace: Pass thread flags to trace enter/exit Jinjie Ruan
2026-07-21  8:18 ` [PATCH v17 08/15] arm64: ptrace: Extract arm64_syscall_exit_to_user_mode_work() helper Jinjie Ruan
2026-07-21  8:45   ` Linus Walleij
2026-07-21  8:18 ` [PATCH v17 09/15] arm64: ptrace: Align syscall exit work semantics with generic entry Jinjie Ruan
2026-07-21  8:46   ` Linus Walleij
2026-07-21  8:18 ` [PATCH v17 10/15] arm64: syscall: Use exit-specific flags check in el0_svc_common() Jinjie Ruan
2026-07-21  8:18 ` [PATCH v17 11/15] arm64: syscall: Simplify el0_svc_common() syscall exit path Jinjie Ruan
2026-07-21  8:51   ` Linus Walleij
2026-07-21  9:30     ` Jinjie Ruan
2026-07-21  8:18 ` [PATCH v17 12/15] arm64: ptrace: Make return type of arm64_syscall_trace_enter() bool Jinjie Ruan
2026-07-21  8:52   ` Linus Walleij
2026-07-21  8:18 ` [PATCH v17 13/15] arm64: entry: Convert to generic entry Jinjie Ruan
2026-07-21  8:18 ` [PATCH v17 14/15] arm64: Inline el0_svc_common() Jinjie Ruan
2026-07-21  8:18 ` [PATCH v17 15/15] arm64: vdso: Expose sigreturn address on vdso to the kernel Jinjie Ruan
2026-07-21  8:51   ` Thomas Weißschuh
2026-07-21  9:23     ` Jinjie Ruan [this message]
2026-07-21  9:55       ` Thomas Weißschuh
2026-07-21  8:55   ` Linus Walleij
2026-07-21  9:27     ` Jinjie Ruan
2026-07-22 18:18     ` Mark Rutland
2026-07-23  1:54       ` Jinjie Ruan

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=8a1c8c38-e89b-4e22-9b46-aa53b0ed30f8@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=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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=tglx@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=thuth@redhat.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®