[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202406271001.67295EE@keescook>
Date: Thu, 27 Jun 2024 10:02:21 -0700
From: Kees Cook <kees@...nel.org>
To: Jinjie Ruan <ruanjinjie@...wei.com>
Cc: Linus Walleij <linus.walleij@...aro.org>, linux@...linux.org.uk,
ardb@...nel.org, arnd@...db.de, afd@...com,
akpm@...ux-foundation.org, rmk+kernel@...linux.org.uk,
eric.devolder@...cle.com, robh@...nel.org, masahiroy@...nel.org,
palmer@...osinc.com, samitolvanen@...gle.com, xiao.w.wang@...el.com,
alexghiti@...osinc.com, nathan@...nel.org, jan.kiszka@...mens.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-efi@...r.kernel.org
Subject: Re: [PATCH v2] ARM: Add support for STACKLEAK gcc plugin
On Thu, Jun 27, 2024 at 03:53:14PM +0800, Jinjie Ruan wrote:
>
>
> On 2024/6/24 15:30, Linus Walleij wrote:
> > On Mon, Jun 24, 2024 at 4:33 AM Jinjie Ruan <ruanjinjie@...wei.com> wrote:
> >
> >> Add the STACKLEAK gcc plugin to arm32 by adding the helper used by
> >> stackleak common code: on_thread_stack(). It initialize the stack with the
> >> poison value before returning from system calls which improves the kernel
> >> security. Additionally, this disables the plugin in EFI stub code and
> >> decompress code, which are out of scope for the protection.
> >>
> >> Before the test on Qemu versatilepb board:
> >> # echo STACKLEAK_ERASING > /sys/kernel/debug/provoke-crash/DIRECT
> >> lkdtm: Performing direct entry STACKLEAK_ERASING
> >> lkdtm: XFAIL: stackleak is not supported on this arch (HAVE_ARCH_STACKLEAK=n)
> >>
> >> After:
> >> # echo STACKLEAK_ERASING > /sys/kernel/debug/provoke-crash/DIRECT
> >> lkdtm: Performing direct entry STACKLEAK_ERASING
> >> lkdtm: stackleak stack usage:
> >> high offset: 80 bytes
> >> current: 280 bytes
> >> lowest: 696 bytes
> >> tracked: 696 bytes
> >> untracked: 192 bytes
> >> poisoned: 7220 bytes
> >> low offset: 4 bytes
> >> lkdtm: OK: the rest of the thread stack is properly erased
> >>
> >> Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
> >> Acked-by: Ard Biesheuvel <ardb@...nel.org>
> >
> > Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
> >
> > I was digging around to see if this would interfere with BPF
> > trampolines, but the
> > BPF code seems so generic that I assume it already takes stackleak into account.
> >
> Thank you very much, as Kees said, can this patch go via
> rmk's patch tracker now?
Probably yes (we have some reviews now). Please go ahead and add it there.
--
Kees Cook
Powered by blists - more mailing lists