[PATCH v3 01/13] stackleak: Rename STACKLEAK to KSTACK_ERASE

Kees Cook kees at kernel.org
Mon Jul 21 13:16:56 PDT 2025


On Mon, Jul 21, 2025 at 10:02:36PM +0200, Nicolas Schier wrote:
> On Thu, Jul 17, 2025 at 04:25:06PM -0700, Kees Cook wrote:
> > In preparation for adding Clang sanitizer coverage stack depth tracking
> > that can support stack depth callbacks:
> > 
> > - Add the new top-level CONFIG_KSTACK_ERASE option which will be
> >   implemented either with the stackleak GCC plugin, or with the Clang
> >   stack depth callback support.
> > - Rename CONFIG_GCC_PLUGIN_STACKLEAK as needed to CONFIG_KSTACK_ERASE,
> >   but keep it for anything specific to the GCC plugin itself.
> > - Rename all exposed "STACKLEAK" names and files to "KSTACK_ERASE" (named
> >   for what it does rather than what it protects against), but leave as
> >   many of the internals alone as possible to avoid even more churn.
> > 
> > While here, also split "prev_lowest_stack" into CONFIG_KSTACK_ERASE_METRICS,
> > since that's the only place it is referenced from.
> > 
> > Suggested-by: Ingo Molnar <mingo at kernel.org>
> > Signed-off-by: Kees Cook <kees at kernel.org>
> > ---
> > Cc: Arnd Bergmann <arnd at arndb.de>
> > Cc: <x86 at kernel.org>
> > Cc: "Gustavo A. R. Silva" <gustavoars at kernel.org>
> > Cc: <linux-doc at vger.kernel.org>
> > Cc: <linux-arm-kernel at lists.infradead.org>
> > Cc: <kvmarm at lists.linux.dev>
> > Cc: <linux-riscv at lists.infradead.org>
> > Cc: <linux-s390 at vger.kernel.org>
> > Cc: <linux-efi at vger.kernel.org>
> > Cc: <linux-hardening at vger.kernel.org>
> > Cc: <linux-kbuild at vger.kernel.org>
> > Cc: <linux-security-module at vger.kernel.org>
> > Cc: <linux-kselftest at vger.kernel.org>
> > ---
> >  arch/Kconfig                                  |  4 +--
> >  arch/arm/Kconfig                              |  2 +-
> >  arch/arm64/Kconfig                            |  2 +-
> >  arch/riscv/Kconfig                            |  2 +-
> >  arch/s390/Kconfig                             |  2 +-
> >  arch/x86/Kconfig                              |  2 +-
> >  security/Kconfig.hardening                    | 36 ++++++++++---------
> >  arch/arm/boot/compressed/Makefile             |  2 +-
> >  arch/arm64/kernel/pi/Makefile                 |  2 +-
> >  arch/arm64/kvm/hyp/nvhe/Makefile              |  2 +-
> >  arch/riscv/kernel/pi/Makefile                 |  2 +-
> >  arch/riscv/purgatory/Makefile                 |  2 +-
> >  arch/x86/purgatory/Makefile                   |  2 +-
> 
> Did you miss arch/loongarch/Kconfig by accident?
> 
> $ git grep -Hrne ARCH_STACKLEAK
> arch/loongarch/Kconfig:127:     select HAVE_ARCH_STACKLEAK

Oh! Yes, I missed that when I rebased to v6.16 (which added loongarch
support for stackleak). Thanks for catching that!

-- 
Kees Cook



More information about the linux-arm-kernel mailing list