Skip to contentSkip to conversation

kasan: push back KASAN_STACK detection to clang-10

PATCH In review Arnd Bergmann 4 participants 4 messages Jul 18, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kasan: push back KASAN_STACK detection to clang-10

asan-stack mode still uses dangerously large kernel stacks of tens of kilobytes in some drivers, and it does not seem that anyone is working on the clang bug.

Let's push this back to clang-10 for now so users don't run into this by accident, and we can test-build allmodconfig kernels using clang-9 without drowning in warnings.

Fixes 6baec880d7a5 ("kasan: turn off asan-stack for clang-8 and earlier")
---
 lib/Kconfig.kasan | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.kasan +1 -1
index 4fafba1a923b..2f260bb63d77 100644
@@ -106,7 +106,7 @@ endchoice
 
 config KASAN_STACK_ENABLE
 	bool "Enable stack instrumentation (unsafe)" if CC_IS_CLANG && !COMPILE_TEST
-	default !(CLANG_VERSION < 90000)
+	default !(CLANG_VERSION < 100000)
 	depends on KASAN
 	help
 	  The LLVM stack address sanitizer has a know problem that
Signature · 1 line
2.20.0
#1 lore raw
Quoted 20 lines · Arnd Bergmann

asan-stack mode still uses dangerously large kernel stacks of tens of kilobytes in some drivers, and it does not seem that anyone is working on the clang bug.

Let's push this back to clang-10 for now so users don't run into this by accident, and we can test-build allmodconfig kernels using clang-9 without drowning in warnings.

Fixes 6baec880d7a5 ("kasan: turn off asan-stack for clang-8 and earlier")
---
 lib/Kconfig.kasan | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.kasan +0 -0
index 4fafba1a923b..2f260bb63d77 100644

lib/Kconfig.kasan endchoice · line 109

Quoted 5 lines
lib/Kconfig.kasan +1 -1
@@ -106,7 +106,7 @@ endchoice
 
 config KASAN_STACK_ENABLE
 	bool "Enable stack instrumentation (unsafe)" if CC_IS_CLANG && !COMPILE_TEST
-	default !(CLANG_VERSION < 90000)
+	default !(CLANG_VERSION < 100000)

Wouldn't be better to make this thing for any clang version? And only when the bug is finally fixed, specify the clang version which can enable this safely.

Quoted 4 lines
lib/Kconfig.kasan +0 -0
 	depends on KASAN
 	help
 	  The LLVM stack address sanitizer has a know problem that
#2 lore raw
Quoted 11 lines · Andrey Ryabinin

lib/Kconfig.kasan endchoice · line 109

Quoted 6 lines · Arnd Bergmann

asan-stack mode still uses dangerously large kernel stacks of tens of kilobytes in some drivers, and it does not seem that anyone is working on the clang bug.

lib/Kconfig.kasan +1 -1
-	default !(CLANG_VERSION < 90000)
+	default !(CLANG_VERSION < 100000)

Wouldn't be better to make this thing for any clang version? And only when the bug is finally fixed, specify the clang version which can enable this safely.

Especially if nobody is currently working on it.

#3 lore raw
Quoted 8 lines · Mark Brown
Quoted 5 lines · Andrey Ryabinin
Quoted 3 lines · Arnd Bergmann

asan-stack mode still uses dangerously large kernel stacks of tens of kilobytes in some drivers, and it does not seem that anyone is working on the clang bug.

Quoted 7 lines
Quoted 5 lines

lib/Kconfig.kasan endchoice · line 109

Quoted 2 lines
lib/Kconfig.kasan +1 -1
-   default !(CLANG_VERSION < 90000)
+   default !(CLANG_VERSION < 100000)

Wouldn't be better to make this thing for any clang version? And only when the bug is finally fixed, specify the clang version which can enable this safely.

Especially if nobody is currently working on it.

I agree.

Signature · 2 lines
Thanks,
~Nick Desaulniers