Kees Cook
unread,Mar 13, 2024, 2:12:24 PMMar 13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Marco Elver, Kees Cook, kernel test robot, Andrey Konovalov, Andrey Ryabinin, kasa...@googlegroups.com, linux-h...@vger.kernel.org, linux-...@vger.kernel.org
For opting functions out of sanitizer coverage, the "no_sanitize"
attribute is used, but in GCC this wasn't introduced until GCC 8.
Disable the sanitizer unless we're not using GCC, or it is GCC
version 8 or higher.
Reported-by: kernel test robot <
l...@intel.com>
Closes:
https://lore.kernel.org/oe-kbuild-all/202403110643...@intel.com/
Signed-off-by: Kees Cook <
kees...@chromium.org>
---
Cc: Marco Elver <
el...@google.com>
Cc: Andrey Konovalov <
andre...@gmail.com>
Cc: Andrey Ryabinin <
ryabin...@gmail.com>
Cc:
kasa...@googlegroups.com
Cc:
linux-h...@vger.kernel.org
---
lib/Kconfig.ubsan | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan
index 48a67058f84e..e81e1ac4a919 100644
--- a/lib/Kconfig.ubsan
+++ b/lib/Kconfig.ubsan
@@ -119,6 +119,8 @@ config UBSAN_SIGNED_WRAP
bool "Perform checking for signed arithmetic wrap-around"
default UBSAN
depends on !COMPILE_TEST
+ # The no_sanitize attribute was introduced in GCC with version 8.
+ depends on !CC_IS_GCC || GCC_VERSION >= 80000
depends on $(cc-option,-fsanitize=signed-integer-overflow)
help
This option enables -fsanitize=signed-integer-overflow which checks
--
2.34.1