Commit b027471a authored by Marco Elver's avatar Marco Elver Committed by Linus Torvalds

Revert "ubsan, kcsan: Don't combine sanitizer with kcov on clang"

This reverts commit ea91a1d4.

Since df05c0e9 ("Documentation: Raise the minimum supported version
of LLVM to 11.0.0") the minimum Clang version is now 11.0, which fixed
the UBSAN/KCSAN vs. KCOV incompatibilities.

Link: https://bugs.llvm.org/show_bug.cgi?id=45831
Link: https://lkml.kernel.org/r/YaodyZzu0MTCJcvO@elver.google.com
Link: https://lkml.kernel.org/r/20220128105631.509772-1-elver@google.comSigned-off-by: default avatarMarco Elver <elver@google.com>
Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0cbcc929
...@@ -10,21 +10,10 @@ config HAVE_KCSAN_COMPILER ...@@ -10,21 +10,10 @@ config HAVE_KCSAN_COMPILER
For the list of compilers that support KCSAN, please see For the list of compilers that support KCSAN, please see
<file:Documentation/dev-tools/kcsan.rst>. <file:Documentation/dev-tools/kcsan.rst>.
config KCSAN_KCOV_BROKEN
def_bool KCOV && CC_HAS_SANCOV_TRACE_PC
depends on CC_IS_CLANG
depends on !$(cc-option,-Werror=unused-command-line-argument -fsanitize=thread -fsanitize-coverage=trace-pc)
help
Some versions of clang support either KCSAN and KCOV but not the
combination of the two.
See https://bugs.llvm.org/show_bug.cgi?id=45831 for the status
in newer releases.
menuconfig KCSAN menuconfig KCSAN
bool "KCSAN: dynamic data race detector" bool "KCSAN: dynamic data race detector"
depends on HAVE_ARCH_KCSAN && HAVE_KCSAN_COMPILER depends on HAVE_ARCH_KCSAN && HAVE_KCSAN_COMPILER
depends on DEBUG_KERNEL && !KASAN depends on DEBUG_KERNEL && !KASAN
depends on !KCSAN_KCOV_BROKEN
select STACKTRACE select STACKTRACE
help help
The Kernel Concurrency Sanitizer (KCSAN) is a dynamic The Kernel Concurrency Sanitizer (KCSAN) is a dynamic
......
...@@ -27,16 +27,6 @@ config UBSAN_TRAP ...@@ -27,16 +27,6 @@ config UBSAN_TRAP
the system. For some system builders this is an acceptable the system. For some system builders this is an acceptable
trade-off. trade-off.
config UBSAN_KCOV_BROKEN
def_bool KCOV && CC_HAS_SANCOV_TRACE_PC
depends on CC_IS_CLANG
depends on !$(cc-option,-Werror=unused-command-line-argument -fsanitize=bounds -fsanitize-coverage=trace-pc)
help
Some versions of clang support either UBSAN or KCOV but not the
combination of the two.
See https://bugs.llvm.org/show_bug.cgi?id=45831 for the status
in newer releases.
config CC_HAS_UBSAN_BOUNDS config CC_HAS_UBSAN_BOUNDS
def_bool $(cc-option,-fsanitize=bounds) def_bool $(cc-option,-fsanitize=bounds)
...@@ -46,7 +36,6 @@ config CC_HAS_UBSAN_ARRAY_BOUNDS ...@@ -46,7 +36,6 @@ config CC_HAS_UBSAN_ARRAY_BOUNDS
config UBSAN_BOUNDS config UBSAN_BOUNDS
bool "Perform array index bounds checking" bool "Perform array index bounds checking"
default UBSAN default UBSAN
depends on !UBSAN_KCOV_BROKEN
depends on CC_HAS_UBSAN_ARRAY_BOUNDS || CC_HAS_UBSAN_BOUNDS depends on CC_HAS_UBSAN_ARRAY_BOUNDS || CC_HAS_UBSAN_BOUNDS
help help
This option enables detection of directly indexed out of bounds This option enables detection of directly indexed out of bounds
...@@ -72,7 +61,6 @@ config UBSAN_ARRAY_BOUNDS ...@@ -72,7 +61,6 @@ config UBSAN_ARRAY_BOUNDS
config UBSAN_LOCAL_BOUNDS config UBSAN_LOCAL_BOUNDS
bool "Perform array local bounds checking" bool "Perform array local bounds checking"
depends on UBSAN_TRAP depends on UBSAN_TRAP
depends on !UBSAN_KCOV_BROKEN
depends on $(cc-option,-fsanitize=local-bounds) depends on $(cc-option,-fsanitize=local-bounds)
help help
This option enables -fsanitize=local-bounds which traps when an This option enables -fsanitize=local-bounds which traps when an
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment