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

From
Kees Cook <kees@kernel.org>
Date
2026-07-09 16:23:48
Also in
linux-alpha, linux-arch, linux-doc, linux-m68k, linux-mips, linux-riscv, linux-s390, linux-sh, linux-um, lkml, loongarch, sparclinux
Reply to
Thomas Gleixner, 2026-07-07
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@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@kernel.org>

-Kees

-- 
Kees Cook
Thread (125 messages) 125 messages, 17 authors, last reply 18d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help