On 7/8/2026 3:06 AM, Thomas Gleixner wrote: > 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 <[email protected]> > Cc: Michael Ellerman <[email protected]> > Cc: Shrikanth Hegde <[email protected]> > Cc: [email protected] > --- > 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 <linux/compat.h> > #include <linux/context_tracking.h> > -#include <linux/randomize_kstack.h> > #include <linux/entry-common.h> > > #include <asm/interrupt.h> > @@ -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); Reviewed-by: Jinjie Ruan <[email protected]> > > if (unlikely(r0 >= NR_syscalls)) { > if (unlikely(trap_is_unsupported_scv(regs))) { >
- Re: [patch 02/18] randomize_kstack: Provide a... Jinjie Ruan
- Re: [patch 02/18] randomize_kstack: Provide a... Kees Cook
- Re: [patch 02/18] randomize_kstack: Provide a... Mukesh Kumar Chaurasiya
- [patch 04/18] loongarch/syscall: Use syscall_enter... Thomas Gleixner
- Re: [patch 04/18] loongarch/syscall: Use sysc... Radu Rendec
- Re: [patch 04/18] loongarch/syscall: Use sysc... Jinjie Ruan
- Re: [patch 04/18] loongarch/syscall: Use sysc... Philippe Mathieu-Daudé
- Re: [patch 04/18] loongarch/syscall: Use sysc... Mukesh Kumar Chaurasiya
- [patch 05/18] powerpc/syscall: Use syscall_enter_f... Thomas Gleixner
- Re: [patch 05/18] powerpc/syscall: Use syscal... Radu Rendec
- Re: [patch 05/18] powerpc/syscall: Use syscal... Jinjie Ruan
- Re: [patch 05/18] powerpc/syscall: Use syscal... Philippe Mathieu-Daudé
- Re: [patch 05/18] powerpc/syscall: Use syscal... Mukesh Kumar Chaurasiya
- [patch 06/18] riscv/syscall: Use syscall_enter_fro... Thomas Gleixner
- Re: [patch 06/18] riscv/syscall: Use syscall_... Radu Rendec
- Re: [patch 06/18] riscv/syscall: Use syscall_... Jinjie Ruan
- Re: [patch 06/18] riscv/syscall: Use syscall_... Philippe Mathieu-Daudé
- Re: [patch 06/18] riscv/syscall: Use syscall_... Mukesh Kumar Chaurasiya
- [patch 07/18] s390/syscall: Use enter_from_user_mo... Thomas Gleixner
- Re: [patch 07/18] s390/syscall: Use enter_fro... Sven Schnelle
- Re: [patch 07/18] s390/syscall: Use enter_fro... Radu Rendec
