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

- From: Arnd Bergmann \<arnd@kernel.org\>
- Date: 2021-01-08 20:32:07 
- List: linux-mediatek
- Page: https://ratatoskr.run/linux-mediatek/2021/01/6228104
- Thread: https://ratatoskr.run/linux-mm/2021/01/6227380/t.md

```text
On Fri, Jan 8, 2021 at 7:56 PM Andrey Konovalov [ref] wrote:
> On Fri, Jan 8, 2021 at 5:09 AM Walter Wu [ref] wrote:

> > @@ -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
```
