2022-11-28 14:45:44

by Anders Roxell

[permalink] [raw]
Subject: Re: [PATCH 2/2] lib: fortify_kunit: build without structleak plugin

On Mon, 28 Nov 2022 at 15:09, Kees Cook <[email protected]> wrote:
>
> On November 28, 2022 2:44:03 AM PST, Anders Roxell <[email protected]> wrote:
> >Building fortify_kunit with strucleak plugin enabled makes the stack
> >frame size to grow.
> >
> >lib/fortify_kunit.c:140:1: error: the frame size of 2368 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
>
> Under what config

I saw this with a arm64 allmodconfig build [1],

> and compiler version do you see these warnings?

Toolchain
aarch64-linux-gnu-gcc (Debian 11.3.0-6) 11.3.0


Cheers,
Anders
[1] http://ix.io/4h6w

>
> -Kees
>
> >
> >Turn off the structleak plugin checks for fortify_kunit.
> >
> >Suggested-by: Arnd Bergmann <[email protected]>
> >Signed-off-by: Anders Roxell <[email protected]>
> >---
> > lib/Makefile | 1 +
> > 1 file changed, 1 insertion(+)
> >
> >diff --git a/lib/Makefile b/lib/Makefile
> >index bdb1552cbe9c..aab32082564a 100644
> >--- a/lib/Makefile
> >+++ b/lib/Makefile
> >@@ -382,6 +382,7 @@ obj-$(CONFIG_OVERFLOW_KUNIT_TEST) += overflow_kunit.o
> > CFLAGS_stackinit_kunit.o += $(call cc-disable-warning, switch-unreachable)
> > obj-$(CONFIG_STACKINIT_KUNIT_TEST) += stackinit_kunit.o
> > CFLAGS_fortify_kunit.o += $(call cc-disable-warning, unsequenced)
> >+CFLAGS_fortify_kunit.o += $(DISABLE_STRUCTLEAK_PLUGIN)
> > obj-$(CONFIG_FORTIFY_KUNIT_TEST) += fortify_kunit.o
> > obj-$(CONFIG_STRSCPY_KUNIT_TEST) += strscpy_kunit.o
> > obj-$(CONFIG_SIPHASH_KUNIT_TEST) += siphash_kunit.o
>
>
> --
> Kees Cook


2022-12-01 17:58:59

by Kees Cook

[permalink] [raw]
Subject: Re: [PATCH 2/2] lib: fortify_kunit: build without structleak plugin

On Mon, Nov 28, 2022 at 03:20:13PM +0100, Anders Roxell wrote:
> On Mon, 28 Nov 2022 at 15:09, Kees Cook <[email protected]> wrote:
> >
> > On November 28, 2022 2:44:03 AM PST, Anders Roxell <[email protected]> wrote:
> > >Building fortify_kunit with strucleak plugin enabled makes the stack
> > >frame size to grow.
> > >
> > >lib/fortify_kunit.c:140:1: error: the frame size of 2368 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]

(It seems like lkml never got this email? Or at least I didn't find it
on lore, so "b4" was unhappy...)

> > Under what config
>
> I saw this with a arm64 allmodconfig build [1],
>
> > and compiler version do you see these warnings?
>
> Toolchain
> aarch64-linux-gnu-gcc (Debian 11.3.0-6) 11.3.0

Thanks! I've applied this to my tree.

--
Kees Cook