[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Tue, 5 May 2020 16:23:24 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Andrey Ryabinin <aryabinin@...tuozzo.com>,
Kees Cook <keescook@...omium.org>,
Andrey Konovalov <andreyknvl@...gle.com>,
Marco Elver <elver@...gle.com>
Cc: Arnd Bergmann <arnd@...db.de>, Dmitry Vyukov <dvyukov@...gle.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Thomas Gleixner <tglx@...utronix.de>,
kasan-dev@...glegroups.com, linux-kernel@...r.kernel.org,
clang-built-linux@...glegroups.com
Subject: [PATCH] ubsan, kcsan: don't combine sanitizer with kcov
Clang does not allow -fsanitize-coverage=trace-{pc,cmp} together
with -fsanitize=bounds or with ubsan:
clang: error: argument unused during compilation: '-fsanitize-coverage=trace-pc' [-Werror,-Wunused-command-line-argument]
clang: error: argument unused during compilation: '-fsanitize-coverage=trace-cmp' [-Werror,-Wunused-command-line-argument]
To avoid that case, add a Kconfig dependency. The dependency could
go either way, disabling CONFIG_KCOV or CONFIG_UBSAN_BOUNDS when the
other is set. I picked the second option here as this seems to have
a smaller impact on the resulting kernel.
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
lib/Kconfig.kcsan | 2 +-
lib/Kconfig.ubsan | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/Kconfig.kcsan b/lib/Kconfig.kcsan
index ea28245c6c1d..8f856c8828d5 100644
--- a/lib/Kconfig.kcsan
+++ b/lib/Kconfig.kcsan
@@ -5,7 +5,7 @@ config HAVE_ARCH_KCSAN
menuconfig KCSAN
bool "KCSAN: dynamic data race detector"
- depends on HAVE_ARCH_KCSAN && DEBUG_KERNEL && !KASAN
+ depends on HAVE_ARCH_KCSAN && DEBUG_KERNEL && !KASAN && !KCOV
select STACKTRACE
help
The Kernel Concurrency Sanitizer (KCSAN) is a dynamic
diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan
index 929211039bac..f98ef029553e 100644
--- a/lib/Kconfig.ubsan
+++ b/lib/Kconfig.ubsan
@@ -29,6 +29,7 @@ config UBSAN_TRAP
config UBSAN_BOUNDS
bool "Perform array index bounds checking"
default UBSAN
+ depends on !(CC_IS_CLANG && KCOV)
help
This option enables detection of directly indexed out of bounds
array accesses, where the array size is known at compile time.
--
2.26.0
Powered by blists - more mailing lists