Re: [PATCH] ubsan: Restore dependency on ARCH_HAS_UBSAN
From: Marco Elver
Date: Wed May 15 2024 - 02:39:01 EST
On Wed, 15 May 2024 at 01:38, Kees Cook <keescook@xxxxxxxxxxxx> wrote:
>
> While removing CONFIG_UBSAN_SANITIZE_ALL, ARCH_HAS_UBSAN wasn't correctly
> depended on. Restore this, as we do not want to attempt UBSAN builds
> unless it's actually been tested on a given architecture.
>
> Reported-by: Masahiro Yamada <masahiroy@xxxxxxxxxx>
> Closes: https://lore.kernel.org/all/20240514095427.541201-1-masahiroy@xxxxxxxxxx
> Fixes: 918327e9b7ff ("ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL")
> Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
Reviewed-by: Marco Elver <elver@xxxxxxxxxx>
> ---
> Cc: Marco Elver <elver@xxxxxxxxxx>
> Cc: Andrey Konovalov <andreyknvl@xxxxxxxxx>
> Cc: Andrey Ryabinin <ryabinin.a.a@xxxxxxxxx>
> Cc: kasan-dev@xxxxxxxxxxxxxxxx
> Cc: linux-hardening@xxxxxxxxxxxxxxx
> ---
> lib/Kconfig.ubsan | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan
> index e81e1ac4a919..bdda600f8dfb 100644
> --- a/lib/Kconfig.ubsan
> +++ b/lib/Kconfig.ubsan
> @@ -4,6 +4,7 @@ config ARCH_HAS_UBSAN
>
> menuconfig UBSAN
> bool "Undefined behaviour sanity checker"
> + depends on ARCH_HAS_UBSAN
> help
> This option enables the Undefined Behaviour sanity checker.
> Compile-time instrumentation is used to detect various undefined
> --
> 2.34.1
>