Re: [PATCH v17 15/15] arm64: vdso: Expose sigreturn address on vdso to the kernel

From: Jinjie Ruan

Date: Tue Jul 21 2026 - 05:32:15 EST




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@xxxxxxxxxxxxx>
>> Suggested-by: Kevin Brodsky <kevin.brodsky@xxxxxxx>
>> Suggested-by: kemal <kmal@xxxxxxx>
>> Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
>> ---
>> 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@xxxxxxxxxxxxx>

Thanks for the review.

>
>
> Thomas