On 7/8/2026 3:05 AM, Thomas Gleixner wrote: > add_random_kstack_offset() is invoked before syscall_enter_from_user_mode() > establishes state. That's wrong because add_random_kstack_offset() calls > into instrumentable code. > > Move it after syscall_enter_from_user_mode() to ensure that state is > correctly established. > > 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 | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- a/arch/powerpc/kernel/syscall.c > +++ b/arch/powerpc/kernel/syscall.c > @@ -19,8 +19,8 @@ notrace long system_call_exception(struc > long ret; > syscall_fn f; > > - add_random_kstack_offset(); > r0 = syscall_enter_from_user_mode(regs, r0); > + add_random_kstack_offset(); Reviewed-by: Jinjie Ruan <[email protected]> > > if (unlikely(r0 >= NR_syscalls)) { > if (unlikely(trap_is_unsupported_scv(regs))) { >
- [patch 11/18] seccomp, treewide: Rename and conver... Thomas Gleixner
- Re: [patch 11/18] seccomp, treewide: Rename a... Jinjie Ruan
- Re: [patch 11/18] seccomp, treewide: Rena... Thomas Gleixner
- Re: [patch 11/18] seccomp, treewide: ... Oleg Nesterov
- Re: [patch 11/18] seccomp, treewi... Thomas Gleixner
- Re: [patch 11/18] seccomp, treewide: Rename a... Kees Cook
- Re: [patch 11/18] seccomp, treewide: Rename a... Mukesh Kumar Chaurasiya
- [patch 01/18] powerpc: Move stack randomization af... Thomas Gleixner
- Re: [patch 01/18] powerpc: Move stack randomi... Shrikanth Hegde
- Re: [patch 01/18] powerpc: Move stack randomi... Radu Rendec
- Re: [patch 01/18] powerpc: Move stack randomi... Jinjie Ruan
- Re: [patch 01/18] powerpc: Move stack randomi... Philippe Mathieu-Daudé
- Re: [patch 01/18] powerpc: Move stack randomi... 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
- Re: [patch 06/18] riscv/syscall: Use syscall_... Guo Ren
- [patch 12/18] ptrace, treewide: Rename ptrace_repo... Thomas Gleixner
- Re: [patch 12/18] ptrace, treewide: Rename pt... Oleg Nesterov
