From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout12.his.huawei.com (canpmsgout12.his.huawei.com [113.46.200.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA153413D8E for ; Tue, 21 Jul 2026 09:23:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.227 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784625830; cv=none; b=JrNBduUtSWD/qWjMSmVW/BLzwch3TnOR9xQj4KSotiXrDwStQK6dnjntwwKvhpmoDSOx7i0MMLtqilICcBlaYsS0/ayE50bkQ7LTMsp8n+0CSHaRs2EZTGt5NisDmo8NqkDn0/rhERJpm4qQqzFnLI9O+r+b5b3xHuSHip8Wth0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784625830; c=relaxed/simple; bh=RTQ7KULoiisZ2qOHV/75vUDO+Y6gfLW7WgGNvpY52HM=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=Iv8IkCAGMCIbjT8jJI2JHxO9mgcsE5qjk9+5UarDOWeUlPG2Aiv+ul6x8C11uNzue8Cyxgjd+cVs2ApHk4NSESn5bOKGrhK10TS984YZUPWj1bO2biyC2/gxP45I5sxjSa6QCJx+0CopNOqKVEcDa7m+gHx+dnHsKl/EMd8NYMk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=3yo5xc/m; arc=none smtp.client-ip=113.46.200.227 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="3yo5xc/m" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=8XzIw7gZRttLMSyjjTDa5uCrHYP0E7vjE31XbWW5ny4=; b=3yo5xc/mSw5KaZCHUE1kDcQbJK/3R42b0Z5+IWLerLM5ObcWveJLPHtuAKwL1gRM/QBHGa5Bs q0aYE4MqVHufVJ50Mf0FP8QC7yoeuz0c/TA9pguWMSY4eKbHqlIg9ZrwNL9wSRgR8IQPflktVXv ahhzzZ0UJNxQ4aFdvHeeYKo= Received: from mail.maildlp.com (unknown [172.19.163.200]) by canpmsgout12.his.huawei.com (SkyGuard) with ESMTPS id 4h4BXM26S6znTbk; Tue, 21 Jul 2026 17:14:11 +0800 (CST) Received: from dggpemf500011.china.huawei.com (unknown [7.185.36.131]) by mail.maildlp.com (Postfix) with ESMTPS id 2569A4055B; Tue, 21 Jul 2026 17:23:43 +0800 (CST) Received: from [10.67.109.254] (10.67.109.254) by dggpemf500011.china.huawei.com (7.185.36.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 21 Jul 2026 17:23:41 +0800 Message-ID: <8a1c8c38-e89b-4e22-9b46-aa53b0ed30f8@huawei.com> Date: Tue, 21 Jul 2026 17:23:38 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v17 15/15] arm64: vdso: Expose sigreturn address on vdso to the kernel To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= CC: , , , , , , , , , , , , , , , , , , , , , , References: <20260721081858.1169276-1-ruanjinjie@huawei.com> <20260721081858.1169276-16-ruanjinjie@huawei.com> <20260721104810-0a8ab042-2705-43e8-90d2-74e221f3fab5@linutronix.de> From: Jinjie Ruan In-Reply-To: <20260721104810-0a8ab042-2705-43e8-90d2-74e221f3fab5@linutronix.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: kwepems200002.china.huawei.com (7.221.188.68) To dggpemf500011.china.huawei.com (7.185.36.131) 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 >> Suggested-by: Kevin Brodsky >> Suggested-by: kemal >> Signed-off-by: Jinjie Ruan >> --- >> 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 Thanks for the review. > > > Thomas