Skip to content

Commit fa360be

Browse files
melvertorvalds
authored andcommitted
kasan: fix Kconfig check of CC_HAS_WORKING_NOSANITIZE_ADDRESS
In the main KASAN config option CC_HAS_WORKING_NOSANITIZE_ADDRESS is checked for instrumentation-based modes. However, if HAVE_ARCH_KASAN_HW_TAGS is true all modes may still be selected. To fix, also make the software modes depend on CC_HAS_WORKING_NOSANITIZE_ADDRESS. Link: https://lkml.kernel.org/r/[email protected] Fixes: 6a63a63 ("kasan: introduce CONFIG_KASAN_HW_TAGS") Signed-off-by: Marco Elver <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Alexander Potapenko <[email protected]> Cc: Andrey Konovalov <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Aleksandr Nogikh <[email protected]> Cc: Taras Madan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent acfa299 commit fa360be

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/Kconfig.kasan

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ choice
6666
config KASAN_GENERIC
6767
bool "Generic mode"
6868
depends on HAVE_ARCH_KASAN && CC_HAS_KASAN_GENERIC
69+
depends on CC_HAS_WORKING_NOSANITIZE_ADDRESS
6970
select SLUB_DEBUG if SLUB
7071
select CONSTRUCTORS
7172
help
@@ -86,6 +87,7 @@ config KASAN_GENERIC
8687
config KASAN_SW_TAGS
8788
bool "Software tag-based mode"
8889
depends on HAVE_ARCH_KASAN_SW_TAGS && CC_HAS_KASAN_SW_TAGS
90+
depends on CC_HAS_WORKING_NOSANITIZE_ADDRESS
8991
select SLUB_DEBUG if SLUB
9092
select CONSTRUCTORS
9193
help

0 commit comments

Comments
 (0)