mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jinjie Ruan <ruanjinjie@huawei.com>
To: Linus Walleij <linusw@kernel.org>
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>, <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:27:04 +0800	[thread overview]
Message-ID: <4b6d760a-8270-443b-878f-37d46d9bed47@huawei.com> (raw)
In-Reply-To: <CAD++jL=Ou_HF5VchexnjUf9qwzrz0xgY+NhA5gZhOwiwdxUi-g@mail.gmail.com>



On 7/21/2026 4:55 PM, Linus Walleij wrote:
> On Tue, Jul 21, 2026 at 10:19 AM Jinjie Ruan <ruanjinjie@huawei.com> 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)
>>
>> 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>
> 
> I'm a bit scared about SUD.
> 
> Certainly we can merge patches 1-14 first and iron out
> any trouble related to that and split this off so a separate
> series to be applied lated?

Yes, Mark's idea is the same. We can place the SUD patch here separately
and wait for thorough testing and review.

Link:
https://lore.kernel.org/all/akZgV0Y4YAmB43_g@J2N7QTR9R3.cambridge.arm.com/

> 
> Yours,
> Linus Walleij


  reply	other threads:[~2026-07-21  9:27 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
2026-07-21  9:55       ` Thomas Weißschuh
2026-07-21  8:55   ` Linus Walleij
2026-07-21  9:27     ` Jinjie Ruan [this message]
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=4b6d760a-8270-443b-878f-37d46d9bed47@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=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®