# Re: \[patch 01/18\] powerpc: Move stack randomization after syscall\_enter\_from\_user\_mode()

- From: Mukesh Kumar Chaurasiya \<hidden\>
- Date: 2026-07-09 18:32:47 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2026/07/17238233
- Thread: https://ratatoskr.run/linuxppc-dev/2026/07/17227033/t.md

```text
On Tue, Jul 07, 2026 at 09:05:58PM +0200, 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 <tglx@kernel.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Shrikanth Hegde <sshegde@linux.ibm.com>
> Cc: <redacted>

Thanks for fixing this.

Reviewed-by: Mukesh Kumar Chaurasiya (IBM) <redacted>

[...]

```
