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: Huacai Chen <[email protected]> > Cc: [email protected] > --- > arch/loongarch/kernel/syscall.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > --- a/arch/loongarch/kernel/syscall.c > +++ b/arch/loongarch/kernel/syscall.c > @@ -11,7 +11,6 @@ > #include <linux/linkage.h> > #include <linux/nospec.h> > #include <linux/objtool.h> > -#include <linux/randomize_kstack.h> > #include <linux/syscalls.h> > #include <linux/unistd.h> > > @@ -70,9 +69,7 @@ void noinstr __no_stack_protector do_sys > regs->orig_a0 = regs->regs[4]; > regs->regs[4] = -ENOSYS; > > - nr = syscall_enter_from_user_mode(regs, nr); > - > - add_random_kstack_offset(); > + nr = syscall_enter_from_user_mode_randomize_stack(regs, nr); Reviewed-by: Jinjie Ruan <[email protected]> > > if (nr < NR_syscalls) { > syscall_fn = sys_call_table[array_index_nospec(nr, > NR_syscalls)]; >
- [patch 03/18] entry: Provide [syscall_]enter_from_... Thomas Gleixner
- Re: [patch 03/18] entry: Provide [syscall_]en... Radu Rendec
- Re: [patch 03/18] entry: Provide [syscall_]en... Jinjie Ruan
- Re: [patch 03/18] entry: Provide [syscall_]en... Jinjie Ruan
- Re: [patch 03/18] entry: Provide [syscall_]en... Philippe Mathieu-Daudé
- [patch 02/18] randomize_kstack: Provide add_random... Thomas Gleixner
- Re: [patch 02/18] randomize_kstack: Provide a... Radu Rendec
- Re: [patch 02/18] randomize_kstack: Provide a... Jinjie Ruan
- [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é
- [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é
- [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é
- [patch 07/18] s390/syscall: Use enter_from_user_mo... Thomas Gleixner
