Re: [patch 03/18] entry: Provide [syscall_]enter_from_user_mode_randomize_stack()

From: Thomas Gleixner

Date: Sat Aug 29 2026 - 17:13:23 EST


On Thu, Aug 27 2026 at 15:46, H. Peter Anvin wrote:
> Can anyone *please* find out what the actual security requirements are for the
> syscall randomization offset?
>
> The original checkin, 39218ff4c625 ("stack: Optionally randomize kernel stack
> offset each syscall") indicates that it is fundamental that the stack offset
> is applied *after* pt_regs pushing, but that isn't documented anywhere in the
> kernel sources as far as I can tell.

> However, I have also come to understand that there are further, undocumented
> constraints; at least at one point I was told that "the offset should not be
> stored in memory while running in the kernel", which seems more than a bit odd.

This thread has the initial discussions about it with more explanations:

https://lore.kernel.org/kernel-hardening/2236FBA76BA1254E88B949DDB74E612BA4BC57C1@xxxxxxxxxxxxxxxxxxxxxxxxxxxx/

Thanks,

tglx