Skip to contentSkip to conversation

ubsan: Restore dependency on ARCH_HAS_UBSAN

PATCH In review Kees Cook 2 participants 2 messages May 14, 2024 – May 15, 2024

Subsystems (2)
lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 ubsan: Restore dependency on ARCH_HAS_UBSAN

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.

Fixes 918327e9b7ff ("ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL")

---
Cc: Marco Elver <[email protected]>
Cc: Andrey Konovalov <[email protected]>
Cc: Andrey Ryabinin <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 lib/Kconfig.ubsan | 1 +
 1 file changed, 1 insertion(+)
lib/Kconfig.ubsan +1 -0
index e81e1ac4a919..bdda600f8dfb 100644
@@ -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
Signature · 1 line
2.34.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Kees Cook

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.

Fixes 918327e9b7ff ("ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL")
Quoted 25 lines

---
Cc: Marco Elver <[email protected]>
Cc: Andrey Konovalov <[email protected]>
Cc: Andrey Ryabinin <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 lib/Kconfig.ubsan | 1 +
 1 file changed, 1 insertion(+)
lib/Kconfig.ubsan +1 -1
index e81e1ac4a919..bdda600f8dfb 100644
@@ -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