mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] kasan: Fix Software Tag-Based KASAN with GCC
@ 2024-10-21 12:00 Marco Elver
  2024-10-21 12:00 ` [PATCH 2/2] Revert "kasan: Disable Software Tag-Based KASAN with GCC" Marco Elver
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Marco Elver @ 2024-10-21 12:00 UTC (permalink / raw)
  To: elver, Will Deacon
  Cc: Andrey Ryabinin, Alexander Potapenko, Andrey Konovalov,
	Dmitry Vyukov, Vincenzo Frascino, Mark Rutland, linux-kernel,
	kasan-dev, llvm, syzbot+908886656a02769af987, Andrew Pinski

Per [1], -fsanitize=kernel-hwaddress with GCC currently does not disable
instrumentation in functions with __attribute__((no_sanitize_address)).

However, __attribute__((no_sanitize("hwaddress"))) does correctly
disable instrumentation. Use it instead.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117196 [1]
Link: https://lore.kernel.org/r/000000000000f362e80620e27859@google.com
Link: https://lore.kernel.org/r/ZvFGwKfoC4yVjN_X@J2N7QTR9R3
Link: https://bugzilla.kernel.org/show_bug.cgi?id=218854
Reported-by: syzbot+908886656a02769af987@syzkaller.appspotmail.com
Tested-by: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrew Pinski <pinskia@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Marco Elver <elver@google.com>
---
 include/linux/compiler-gcc.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index f805adaa316e..cd6f9aae311f 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -80,7 +80,11 @@
 #define __noscs __attribute__((__no_sanitize__("shadow-call-stack")))
 #endif
 
+#ifdef __SANITIZE_HWADDRESS__
+#define __no_sanitize_address __attribute__((__no_sanitize__("hwaddress")))
+#else
 #define __no_sanitize_address __attribute__((__no_sanitize_address__))
+#endif
 
 #if defined(__SANITIZE_THREAD__)
 #define __no_sanitize_thread __attribute__((__no_sanitize_thread__))
-- 
2.47.0.rc1.288.g06298d1525-goog


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

end of thread, other threads:[~2024-10-23 16:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-21 12:00 [PATCH 1/2] kasan: Fix Software Tag-Based KASAN with GCC Marco Elver
2024-10-21 12:00 ` [PATCH 2/2] Revert "kasan: Disable Software Tag-Based KASAN with GCC" Marco Elver
2024-10-21 17:13   ` Andrey Konovalov
2024-10-21 17:12 ` [PATCH 1/2] kasan: Fix Software Tag-Based KASAN with GCC Andrey Konovalov
2024-10-21 17:20 ` Will Deacon
2024-10-21 17:29   ` Andrew Pinski
2024-10-22 21:42     ` Marco Elver
2024-10-23 14:55       ` Will Deacon
2024-10-23 16:21 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®