From mboxrd@z Thu Jan 1 00:00:00 1970 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 128423AEF51; Sun, 12 Jul 2026 12:44:14 +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=1783860256; cv=none; b=RsjoJcvalG60FXBdcrjJi1h22Y0zLyfaetoHMzAmEbpP9n/ICIwN68k+9GZJdnXkgyFboYGTpqc6/c/JceqJigZ1QfGyY8FdJSapwL9oj4ZBaGrfdPtTQIzMshmYbqiR9JupGspS+SKjxSTzyYBrabjG9/+Twjcfk80iNo1P03E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783860256; c=relaxed/simple; bh=5GjyK/PaTrRqloxuVf5+Rj16WdpDuMQTTKN6LaFYJAM=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=CiLnsCACfkgNVA7OjdF85XHcP88YvaHX0KpnKsBs6RW4KQGwI75vSErumitUbavXbHmYaRP/jUdUb7wyJ6qeqydt8Z1Y02O1VH/gRy57adLT0it/S4XtRwE/dSqPuj02bjVtRGgzXlggm8xVxxCFwXa941I+QgkOYSTOxuHyFY4= 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=T6ZQPaeX; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=7oUunu1c; 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="T6ZQPaeX"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="7oUunu1c" Date: Sun, 12 Jul 2026 12:44:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1783860251; 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=RyacOqm+GP+YnFi2HJLUrNiTCPuMpYwxt5UUoBUl2RU=; b=T6ZQPaeXmng6AXVzfAEzpJUtuT2DLyD6j9KjU1lsj5SqMIkcNcMd/NR2On/xp92w2bYo9A ipnM1tweD2nH/j4lEAGyN7SuxuHlAYpYJ0fC8vSTOkUwv/w6PlMBJ1S6EIR3E10+gZtQRS Efed53f7Uma/CLQCeS1BS039zhrI++STYFrbBYx1sna7RABKE7XkTM016j87Sv9h/GG8YB /a/mQQ2MrLAxxyT3SUOkKWJre1NXCv/sAwsC01lBwE8uHYI4SVMcglU4HS/Yd/hYDyFZyp GpYI7mPetCCMf1eUPLOv0RmgiA8FXlSF0GrELh/HeSBwAdBiNvCrolJB15bqiQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1783860251; 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=RyacOqm+GP+YnFi2HJLUrNiTCPuMpYwxt5UUoBUl2RU=; b=7oUunu1chSZxAw91hkWTssuJnSSc4SqYYlBxhP8mQnL9eq5LmE5rY/2wIWMejANXvzEprr IfWxbED2oevsK7DA== 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] loongarch/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.865955911@kernel.org> References: <20260707190253.865955911@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178386025022.1844600.1943491736657401480.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: 7892c5a22a4e11d1ed3590c04ff73f047c0ce453 Gitweb: https://git.kernel.org/tip/7892c5a22a4e11d1ed3590c04ff73f047c0= ce453 Author: Thomas Gleixner AuthorDate: Tue, 07 Jul 2026 21:06:11 +02:00 Committer: Thomas Gleixner CommitterDate: Sun, 12 Jul 2026 12:38:01 +02:00 loongarch/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.865955911@kernel.org --- arch/loongarch/kernel/syscall.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/loongarch/kernel/syscall.c b/arch/loongarch/kernel/syscall.c index 94c1c3b..142a9c2 100644 --- a/arch/loongarch/kernel/syscall.c +++ b/arch/loongarch/kernel/syscall.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include =20 @@ -70,9 +69,7 @@ void noinstr __no_stack_protector do_syscall(struct pt_regs= *regs) regs->orig_a0 =3D regs->regs[4]; regs->regs[4] =3D -ENOSYS; =20 - nr =3D syscall_enter_from_user_mode(regs, nr); - - add_random_kstack_offset(); + nr =3D syscall_enter_from_user_mode_randomize_stack(regs, nr); =20 if (nr < NR_syscalls) { syscall_fn =3D sys_call_table[array_index_nospec(nr, NR_syscalls)];