Re: [patch 02/18] randomize_kstack: Provide add_random_kstack_offset_irqsoff()
Kees Cook <[email protected]> Thu, 9 Jul 2026 09:23:47 -0700
| Newsgroups | gmane.linux.ports.alpha,gmane.linux.kernel,gmane.linux.ports.ppc64.devel,gmane.linux.ports.riscv,gmane.linux.ports.arm.kernel,gmane.linux.ports.mips,gmane.linux.ports.parisc,gmane.linux.ports.sh.devel,gmane.linux.uml.devel,gmane.linux.kernel.arc,gmane.linux.ports.hexagon,gmane.linux.ports.sparc,gmane.linux.kernel.cross-arch,gmane.linux.documentation |
|---|---|
| Message-ID | <202607090922.4ECAE32C07@keescook> |
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 <[email protected]> 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 <[email protected]> -Kees -- Kees Cook