Re: [PATCH v3] kasan: remove redundant config option

From
Arnd Bergmann <arnd@kernel.org>
Date
2021-01-08 20:32:07
Also in
linux-arm-kernel, linux-mm, lkml
Reply to
Andrey Konovalov, 2021-01-08
On Fri, Jan 8, 2021 at 7:56 PM Andrey Konovalov [off-list ref] wrote:
On Fri, Jan 8, 2021 at 5:09 AM Walter Wu [off-list ref] wrote:
quoted
@@ -2,6 +2,12 @@
 CFLAGS_KASAN_NOSANITIZE := -fno-builtin
 KASAN_SHADOW_OFFSET ?= $(CONFIG_KASAN_SHADOW_OFFSET)

+ifdef CONFIG_KASAN_STACK
+       stack_enable := 1
+else
+       stack_enable := 0
+endif
+
AFAIR, Arnd wanted to avoid having KASAN_STACK to be enabled by
default when compiling with Clang, since Clang instrumentation leads
to very large kernel stacks, which, in turn, lead to compile-time
warnings. What I don't remember is why there are two configs.

Arnd, is that correct? What was the reason behind having two configs?
I think I just considered it cleaner than defining the extra variable in the
Makefile at the time, as this was the only place that referenced
CONFIG_KASAN_STACK.

The '#if CONFIG_KASAN_STACK' (rather than #ifdef) that got added
later do make my version more confusing though, so I agree that
Walter's second patch improves it.

Acked-by: Arnd Bergmann <arnd@arndb.de>

On a related note: do you have any hope that clang will ever fix
https://bugs.llvm.org/show_bug.cgi?id=38809 and KASAN_STACK
can be enabled by default on clang without risking stack
overflows?

       Arnd

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Thread (11 messages) 11 messages, 4 authors, last reply 2021-01-11
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help