Thread (94 messages) 94 messages, 12 authors, 16h ago

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

From: Philippe Mathieu-Daudé <hidden>
Date: 2026-07-09 11:15:18
Also in: linux-alpha, linux-arch, linux-doc, linux-m68k, linux-mips, linux-riscv, linux-s390, linux-sh, linux-um, lkml, loongarch, sparclinux

On 7/7/26 21:06, Thomas Gleixner wrote:
Randomizing the syscall stack can only happen after state is established
via enter_from_user_mode() or syscall_enter_from_user_mode(). The earlier
it happens the better.

Provide two new macros to consolidate that:

   - enter_from_user_mode_randomize_stack()
	enter_from_user_mode();
	add_random_kstack_offset_irqsoff();

   - syscall_enter_from_user_mode_randomize_stack()
	enter_from_user_mode_randomize_stack();
	syscall_enter_from_user_mode_work();
     
to reduce boiler plate code.

Those are macros and not inline functions as the latter would limit the
stack randomization scope to the inline function itself.

Signed-off-by: Thomas Gleixner <tglx@kernel.org>
---
  include/linux/entry-common.h |   56 +++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 56 insertions(+)
Reviewed-by: Philippe Mathieu-Daudé <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help