From nobody Sat Jul 25 23:05:42 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 4B3A83AA1BB; Sun, 12 Jul 2026 12:44:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783860253; cv=none; b=TAT/5dYYYdv7JqkRpwrR1NSgCuZkJUSuRxGCUjtv8CYWgk3mQtwFtZdBhPy6v1sJsbg9r+pufOCPrr530pmt+t7XiYlpPPOQRMINs9mSBYcI4k9A82scJ/ix0xcY/ViUUzeKBxOOPRZ+eAD9gQPkzawD0U0NPBePerYULloZ3Qk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783860253; c=relaxed/simple; bh=S1ygP+9T4ItF+Lz5XSu+u8FfE2jukEAM9S9dS90AVbM=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=JFFIw/kAYqEGAETi3A5sZQNEHqJ9wAOsTZWLBycidg226KJpT6rag484R868vds1KTQJy4eiuTaV4FZqb9RnB8RAdBQAXG5HMphqnKkA06j5DwnfBv+S1gU6PkGAUYhRkMX9c8rMqBjA35OiqwiKMOB3lFnumjLYQ9sef5I/lPY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=CpJlh8qz; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=BF9H2zI+; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="CpJlh8qz"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="BF9H2zI+" Date: Sun, 12 Jul 2026 12:44:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1783860248; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fTVLiR7A0B8rU0loa25Kw8ZJZCBHcsatZIGzr+pRjkU=; b=CpJlh8qzD3dKZicBNc/4Vy3x2Pn6XnGZnGbzKMrXEUnyFWgY3kwJ5phbhcftQaAm2ZkldS y9EN56a6UKBXT4DLKHGCSAYUYkhwQvFFgPZ3FTNQ7x8Co403Je1sU1asBonAzEPUOLWMZp rC4TNV8SBopD6MDivPxxw4gOuqzgrrb9oS3iVj8addajzXcVatTKezUgvVmvmAw0XsXWcK 8wOsPOwQqozWS+bfgYeToQQMIIcazmfXROcYbGrmJHK2deKywQYYhU4EvsvmV69SABqUtq pqlirVkQCoS4VVrJD/p9cuLLj4hjq5wq9/GQTEEn/fT9JRdxksjGmRACox3VLQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1783860248; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fTVLiR7A0B8rU0loa25Kw8ZJZCBHcsatZIGzr+pRjkU=; b=BF9H2zI+C7Xec+vmZHrPHTBdJoAjCEODdBOZqdfVp0iCnrIpt3tCHSDzjb/2Ph0+kZLy2X fAdNGLMrnZyRhTAw== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: core/entry] riscv/syscall: Use syscall_enter_from_user_mode_randomize_stack() Cc: Thomas Gleixner , Radu Rendec , Jinjie Ruan , philmd@oss.qualcomm.com, "Mukesh Kumar Chaurasiya (IBM)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260707190253.974626922@kernel.org> References: <20260707190253.974626922@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178386024715.1844600.956678426891198455.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the core/entry branch of tip: Commit-ID: d023abfbc4dca9ad9c9928b5b5a38b1628ee1a5d Gitweb: https://git.kernel.org/tip/d023abfbc4dca9ad9c9928b5b5a38b162= 8ee1a5d Author: Thomas Gleixner AuthorDate: Tue, 07 Jul 2026 21:06:19 +02:00 Committer: Thomas Gleixner CommitterDate: Sun, 12 Jul 2026 12:38:01 +02:00 riscv/syscall: Use syscall_enter_from_user_mode_randomize_stack() syscall_enter_from_user_mode_randomize_stack() replaces syscall_enter_from_user_mode() and the subsequent invocation of add_random_kstack_offset(). The advantage is that it applies the stack randomization right after enter_from_user_mode() and thereby avoids the overhead of get/put_cpu_var() as that code is invoked with interrupts disabled. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Radu Rendec Reviewed-by: Jinjie Ruan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mukesh Kumar Chaurasiya (IBM) Link: https://patch.msgid.link/20260707190253.974626922@kernel.org --- arch/riscv/kernel/traps.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c index 8c62c77..bb18011 100644 --- a/arch/riscv/kernel/traps.c +++ b/arch/riscv/kernel/traps.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -333,9 +332,7 @@ void do_trap_ecall_u(struct pt_regs *regs) =20 riscv_v_vstate_discard(regs); =20 - syscall =3D syscall_enter_from_user_mode(regs, syscall); - - add_random_kstack_offset(); + syscall =3D syscall_enter_from_user_mode_randomize_stack(regs, syscall); =20 if (syscall >=3D 0 && syscall < NR_syscalls) { syscall =3D array_index_nospec(syscall, NR_syscalls);