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 <[email protected]>
---
  include/linux/entry-common.h |   56 
+++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 56 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>

Reply via email to