From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 C6B023A874D; Tue, 7 Jul 2026 19:06:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783451182; cv=none; b=L2U/DumxxRBtakccud0JgQGgk6LneDZlflvLPlb2lco2JiCD4nqkzImwGlFGe2LBhz4RFLhMjjAUKUULRVAIGAo11X8IwzBRnGVjNQJa3nlLPbV6PgDQUnv3aVgTZ0n4pYPOATv79P+LYVr3Cja2A7OFUgET25RjcxabVYkqLX8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783451182; c=relaxed/simple; bh=sal912FX10mEEdn6Oo/dvcWP02bURNYRJM01yX8XZQ0=; h=Date:Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=F1YAzGneVt8pVLCBhkYvN/1evB+fEQjJ8LDD8FmF17cGZhhkUwDOF/YjqG/SrfORwZA8MfbiQXORskik6G5L0eg11AY9RynbIounseUVv1NAN7i98hlQwIMJOwN4dg7v3TkQehn//TcExFfhtDRfDA6nRs4kc9XEjx0ZuznNbc8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aJaRZSNF; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aJaRZSNF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14E0D1F00A3A; Tue, 7 Jul 2026 19:06:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783451177; bh=bqcx1niI7ioy3DW+/gZQ2MbLYJEE35hyG+fCdizbDSo=; h=Date:From:To:Cc:Subject:References; b=aJaRZSNFmGdCFvruVG7x5xRrvggSIGN0GND+eCq7/up7llJN2RLb5yTt7nKiF5bMl dDjbHacdEwTpP5I1/lusznloh2jALXKsApluk4rrQ6UjQSVw3qYVOOw6/ktRrDvDFv 6mM4CdAeBuHePM8toFrWSjVi5vf12es33TiR0Erbaqy0+HMgOhtPrzfLuSaVmJcBBf Qwx11aY+YPFSRPD5t62E+zU8M90fmxRE9JPIpsU8ZmTyzhptaz9i1jNQWCYVnDIzEX +BqGBqk3JLQ87YaLjGkYNumyEdOthBs5KZUcJ25lEB3+VQ9NuYSR6XQbeSkS9Uk7wj gTZuo3rzjPU7w== Date: Tue, 07 Jul 2026 21:06:15 +0200 Message-ID: <20260707190253.918861529@kernel.org> User-Agent: quilt/0.69 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Michael Ellerman , Shrikanth Hegde , linuxppc-dev@lists.ozlabs.org, Kees Cook , Huacai Chen , loongarch@lists.linux.dev, Paul Walmsley , Palmer Dabbelt , linux-riscv@lists.infradead.org, Sven Schnelle , linux-s390@vger.kernel.org, x86@kernel.org, Mark Rutland , Jinjie Ruan , Andy Lutomirski , Oleg Nesterov , Richard Henderson , Russell King , Catalin Marinas , Guo Ren , Geert Uytterhoeven , Thomas Bogendoerfer , Helge Deller , Yoshinori Sato , Richard Weinberger , Chris Zankel , linux-arm-kernel@lists.infradead.org, linux-alpha@vger.kernel.org, linux-csky@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org, Arnd Bergmann , Vineet Gupta , Will Deacon , Brian Cain , Michal Simek , Dinh Nguyen , "David S. Miller" , Andreas Larsson , linux-snps-arc@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-openrisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, =?UTF-8?q?Michal=20Such=C3=A1nek?= , Jonathan Corbet , linux-doc@vger.kernel.org Subject: [patch 05/18] powerpc/syscall: Use syscall_enter_from_user_mode_randomize_stack() References: <20260707181957.433213175@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 Cc: Michael Ellerman Cc: Shrikanth Hegde Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/kernel/syscall.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/arch/powerpc/kernel/syscall.c +++ b/arch/powerpc/kernel/syscall.c @@ -2,7 +2,6 @@ #include #include -#include #include #include @@ -19,8 +18,7 @@ notrace long system_call_exception(struc long ret; syscall_fn f; - r0 = syscall_enter_from_user_mode(regs, r0); - add_random_kstack_offset(); + r0 = syscall_enter_from_user_mode_randomize_stack(regs, r0); if (unlikely(r0 >= NR_syscalls)) { if (unlikely(trap_is_unsupported_scv(regs))) {