Re: [PATCH v16 18/18] arm64: vdso: Expose sigreturn address on vdso to the kernel
From: Jinjie Ruan
Date: Thu Jul 09 2026 - 02:37:04 EST
On 6/30/2026 11:14 PM, Ada Couprie Diaz wrote:
> Hi Jinjie,
>
> On 29/06/2026 14:06, Jinjie Ruan wrote:
>
>> Syscall User Dispatch (SUD) requires the signal trampoline code to not be
>> intercepted. This is necessary to support returning with a locked
>> selector
>> while avoiding infinite recursion back into the signal handler.
>
> Thanks for splitting this out, I find it is much clearer that way !
>
> However, this should definitely be earlier in the series
> As I mentioned in my comment in v15, Syscall User Dispatch only depends
> on `CONFIG_GENERIC_ENTRY`, so enabling generic entry for arm64 in patch 16
> also enables Syscall User Dispatch.
>
> Given that this series adds a weak default function returning false for
> `arch_syscall_is_vdso_sigreturn()` before enabling generic entry for arm64
> in patch 16, patch 16 and 17 have a potentially broken SUD enabled,
> as we do not check for those sigreturns yet.
>
> I think shuffling this patch back just before converting to generic entry
> should be OK !
As Mark suggested, we can decouple the generic entry and
syscall_user_dispatch features. First, we can focus on switching to the
generic entry, and then implement syscall_user_dispatch.
>
>>
>> Implement arch_syscall_is_vdso_sigreturn() for arm64 to support this
>> exclusion mechanism. For native 64-bit tasks, it checks whether the
>> current
>> PC matches the 'svc #0' instruction inside the vDSO sigreturn trampoline.
>>
>> SYM_CODE_START(__kernel_rt_sigreturn)
>> mov x8, #__NR_rt_sigreturn
>> svc #0
>> SYM_CODE_END(__kernel_rt_sigreturn)
> Maybe add `arch/arm64/kernel/vdso/sigreturn.S` to mention where
> this snippet comes from ?
>>
>> For COMPAT tasks, it verifies if the instruction falls within
>> the architecture's 'sigpage' range, allowing the kernel to safely bypass
>> dispatching syscalls originating from these areas back to userspace.
> I think this might benefit from a bit more details or clarity on the "why"
> of the COMPAT handling : there is a vDSO page for COMPAT tasks, but
> COMPAT signal handlers have their own dedicated page, `sigpage`,
> which serves the same purpose and is handled similarly, so it needs
> to be checked as well.
>
> Hopefully that is correct... Would you find that relevant information to
> add ?
> Pinging @Kevin Brodsky on that as well.
Thank you for the review. The related information needs
to be improved.
>
>> Suggested-by: Kevin Brodsky <kevin.brodsky@xxxxxxx>
>> Suggested-by: kemal <kmal@xxxxxxx>
>> Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
>> ---
>> arch/arm64/include/asm/elf.h | 1 +
>> arch/arm64/kernel/vdso.c | 16 ++++++++++++++++
>> 2 files changed, 17 insertions(+)
>
> Otherwise this looks good to me, great to have more context with the
> change !
>
> Thanks,
> Ada
>
>