[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250507-righteous-turquoise-bustard-4fca48@l-nschier-aarch64>
Date: Wed, 7 May 2025 14:14:51 +0200
From: Nicolas Schier <nicolas.schier@...ux.dev>
To: Kees Cook <kees@...nel.org>
Cc: Masahiro Yamada <masahiroy@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Petr Pavlu <petr.pavlu@...e.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
linux-kbuild@...r.kernel.org, Justin Stitt <justinstitt@...gle.com>,
Marco Elver <elver@...gle.com>,
Andrey Konovalov <andreyknvl@...il.com>,
Andrey Ryabinin <ryabinin.a.a@...il.com>,
Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
Bill Wendling <morbo@...gle.com>, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org, kasan-dev@...glegroups.com,
llvm@...ts.linux.dev
Subject: Re: [PATCH v3 2/3] randstruct: Force full rebuild when seed changes
On Sat, 03 May 2025, Kees Cook wrote:
> While the randstruct GCC plugin was being rebuilt if the randstruct seed
> changed, Clang builds did not notice the change. This could result in
> differing struct layouts in a target depending on when it was built.
>
> Include the existing generated header file in compiler-version.h when
> its associated feature name, RANDSTRUCT, is defined. This will be picked
> up by fixdep and force rebuilds where needed.
>
> Signed-off-by: Kees Cook <kees@...nel.org>
> ---
> Cc: Masahiro Yamada <masahiroy@...nel.org>
> Cc: Nathan Chancellor <nathan@...nel.org>
> Cc: Nicolas Schier <nicolas.schier@...ux.dev>
> Cc: Petr Pavlu <petr.pavlu@...e.com>
> Cc: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> Cc: <linux-kbuild@...r.kernel.org>
> ---
> include/linux/compiler-version.h | 3 +++
> include/linux/vermagic.h | 1 -
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/compiler-version.h b/include/linux/compiler-version.h
> index 74ea11563ce3..69b29b400ce2 100644
> --- a/include/linux/compiler-version.h
> +++ b/include/linux/compiler-version.h
> @@ -16,3 +16,6 @@
> #ifdef GCC_PLUGINS
> #include <generated/gcc-plugins.h>
> #endif
> +#ifdef RANDSTRUCT
> +#include <generated/randstruct_hash.h>
> +#endif
> diff --git a/include/linux/vermagic.h b/include/linux/vermagic.h
> index 939ceabcaf06..335c360d4f9b 100644
> --- a/include/linux/vermagic.h
> +++ b/include/linux/vermagic.h
> @@ -33,7 +33,6 @@
> #define MODULE_VERMAGIC_MODVERSIONS ""
> #endif
> #ifdef RANDSTRUCT
> -#include <generated/randstruct_hash.h>
> #define MODULE_RANDSTRUCT "RANDSTRUCT_" RANDSTRUCT_HASHED_SEED
> #else
> #define MODULE_RANDSTRUCT
> --
> 2.34.1
>
Reviewed-by: Nicolas Schier <n.schier@....de>
Tested-by: Nicolas Schier <n.schier@....de>
Powered by blists - more mailing lists