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

From: Anders Roxell
Date: Mon Nov 28 2022 - 09:20:34 EST


On Mon, 28 Nov 2022 at 15:09, Kees Cook <kees@xxxxxxxxxx> wrote:
>
> On November 28, 2022 2:44:03 AM PST, Anders Roxell <anders.roxell@xxxxxxxxxx> 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 <arnd@xxxxxxxx>
> >Signed-off-by: Anders Roxell <anders.roxell@xxxxxxxxxx>
> >---
> > 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