linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [v2] kasan: remove clang version check for KASAN_STACK
@ 2019-07-19 20:03 Arnd Bergmann
  2019-07-19 20:56 ` Nick Desaulniers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arnd Bergmann @ 2019-07-19 20:03 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Qian Cai, Mark Brown, Andrey Konovalov, Arnd Bergmann,
	Andrey Ryabinin, Vasily Gorbik, linux-kernel, clang-built-linux

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.

Turn it off for all clang versions to prevent users from
accidentally enabling it once they update to clang-9, and
to help automated build testing with clang-9.

Link: https://bugs.llvm.org/show_bug.cgi?id=38809
Fixes: 6baec880d7a5 ("kasan: turn off asan-stack for clang-8 and earlier")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
v2: disable the feature for all clang versions, not just 9 and below.
---
 lib/Kconfig.kasan | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan
index 4fafba1a923b..7fa97a8b5717 100644
--- a/lib/Kconfig.kasan
+++ b/lib/Kconfig.kasan
@@ -106,7 +106,6 @@ endchoice
 
 config KASAN_STACK_ENABLE
 	bool "Enable stack instrumentation (unsafe)" if CC_IS_CLANG && !COMPILE_TEST
-	default !(CLANG_VERSION < 90000)
 	depends on KASAN
 	help
 	  The LLVM stack address sanitizer has a know problem that
@@ -115,11 +114,11 @@ config KASAN_STACK_ENABLE
 	  Disabling asan-stack makes it safe to run kernels build
 	  with clang-8 with KASAN enabled, though it loses some of
 	  the functionality.
-	  This feature is always disabled when compile-testing with clang-8
-	  or earlier to avoid cluttering the output in stack overflow
-	  warnings, but clang-8 users can still enable it for builds without
-	  CONFIG_COMPILE_TEST.  On gcc and later clang versions it is
-	  assumed to always be safe to use and enabled by default.
+	  This feature is always disabled when compile-testing with clang
+	  to avoid cluttering the output in stack overflow warnings,
+	  but clang users can still enable it for builds without
+	  CONFIG_COMPILE_TEST.	On gcc it is assumed to always be safe
+	  to use and enabled by default.
 
 config KASAN_STACK
 	int
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] [v2] kasan: remove clang version check for KASAN_STACK
  2019-07-19 20:03 [PATCH] [v2] kasan: remove clang version check for KASAN_STACK Arnd Bergmann
@ 2019-07-19 20:56 ` Nick Desaulniers
  2019-07-22 12:27 ` Andrey Ryabinin
  2019-07-22 12:38 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Nick Desaulniers @ 2019-07-19 20:56 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andrew Morton, Qian Cai, Mark Brown, Andrey Konovalov,
	Andrey Ryabinin, Vasily Gorbik, LKML, clang-built-linux,
	Kostya Serebryany, Dmitry Vyukov, Alexander Potapenko

On Fri, Jul 19, 2019 at 1:03 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> 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.

Acked-by: Nick Desaulniers <ndesaulniers@google.com>

>
> Turn it off for all clang versions to prevent users from
> accidentally enabling it once they update to clang-9, and
> to help automated build testing with clang-9.
>
> Link: https://bugs.llvm.org/show_bug.cgi?id=38809
> Fixes: 6baec880d7a5 ("kasan: turn off asan-stack for clang-8 and earlier")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> v2: disable the feature for all clang versions, not just 9 and below.
> ---
>  lib/Kconfig.kasan | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan
> index 4fafba1a923b..7fa97a8b5717 100644
> --- a/lib/Kconfig.kasan
> +++ b/lib/Kconfig.kasan
> @@ -106,7 +106,6 @@ endchoice
>
>  config KASAN_STACK_ENABLE
>         bool "Enable stack instrumentation (unsafe)" if CC_IS_CLANG && !COMPILE_TEST
> -       default !(CLANG_VERSION < 90000)
>         depends on KASAN
>         help
>           The LLVM stack address sanitizer has a know problem that
> @@ -115,11 +114,11 @@ config KASAN_STACK_ENABLE
>           Disabling asan-stack makes it safe to run kernels build
>           with clang-8 with KASAN enabled, though it loses some of
>           the functionality.
> -         This feature is always disabled when compile-testing with clang-8
> -         or earlier to avoid cluttering the output in stack overflow
> -         warnings, but clang-8 users can still enable it for builds without
> -         CONFIG_COMPILE_TEST.  On gcc and later clang versions it is
> -         assumed to always be safe to use and enabled by default.
> +         This feature is always disabled when compile-testing with clang
> +         to avoid cluttering the output in stack overflow warnings,
> +         but clang users can still enable it for builds without
> +         CONFIG_COMPILE_TEST.  On gcc it is assumed to always be safe
> +         to use and enabled by default.
>
>  config KASAN_STACK
>         int
> --
> 2.20.0
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20190719200347.2596375-1-arnd%40arndb.de.



-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [v2] kasan: remove clang version check for KASAN_STACK
  2019-07-19 20:03 [PATCH] [v2] kasan: remove clang version check for KASAN_STACK Arnd Bergmann
  2019-07-19 20:56 ` Nick Desaulniers
@ 2019-07-22 12:27 ` Andrey Ryabinin
  2019-07-22 12:38 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Andrey Ryabinin @ 2019-07-22 12:27 UTC (permalink / raw)
  To: Arnd Bergmann, Andrew Morton
  Cc: Qian Cai, Mark Brown, Andrey Konovalov, Vasily Gorbik,
	linux-kernel, clang-built-linux



On 7/19/19 11:03 PM, Arnd Bergmann wrote:
> 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.
> 
> Turn it off for all clang versions to prevent users from
> accidentally enabling it once they update to clang-9, and
> to help automated build testing with clang-9.
> 
> Link: https://bugs.llvm.org/show_bug.cgi?id=38809
> Fixes: 6baec880d7a5 ("kasan: turn off asan-stack for clang-8 and earlier")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

Reviewed-by: Andrey Ryabinin <aryabinin@virtuozzo.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [v2] kasan: remove clang version check for KASAN_STACK
  2019-07-19 20:03 [PATCH] [v2] kasan: remove clang version check for KASAN_STACK Arnd Bergmann
  2019-07-19 20:56 ` Nick Desaulniers
  2019-07-22 12:27 ` Andrey Ryabinin
@ 2019-07-22 12:38 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2019-07-22 12:38 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andrew Morton, Qian Cai, Andrey Konovalov, Andrey Ryabinin,
	Vasily Gorbik, linux-kernel, clang-built-linux

[-- Attachment #1: Type: text/plain, Size: 274 bytes --]

On Fri, Jul 19, 2019 at 10:03:31PM +0200, Arnd Bergmann wrote:
> 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.

Reviewed-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-22 12:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-19 20:03 [PATCH] [v2] kasan: remove clang version check for KASAN_STACK Arnd Bergmann
2019-07-19 20:56 ` Nick Desaulniers
2019-07-22 12:27 ` Andrey Ryabinin
2019-07-22 12:38 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).