[patch 02/18] randomize_kstack: Provide add_random_kstack_offset_irqsoff()

Kees Cook kees at kernel.org
Thu Jul 9 09:23:47 PDT 2026


On Tue, Jul 07, 2026 at 09:06:02PM +0200, Thomas Gleixner wrote:
> add_random_kstack_offset() uses get/put_cpu_var() which is pointless
> overhead when it is invoked from low level entry code with interrupts
> disabled.
> 
> Provide a irqsoff() variant, which avoids that.
> 
> Signed-off-by: Thomas Gleixner <tglx at kernel.org>

Seems good. I don't think macro'izing the interior is worth it since
both cases are very short, with only the lockdep and raw bits changed.

Reviewed-by: Kees Cook <kees at kernel.org>

-Kees

-- 
Kees Cook



More information about the linux-riscv mailing list