]> git.hungrycats.org Git - linux/commit
kasan: Fix Software Tag-Based KASAN with GCC
authorMarco Elver <elver@google.com>
Mon, 21 Oct 2024 12:00:10 +0000 (14:00 +0200)
committerWill Deacon <will@kernel.org>
Wed, 23 Oct 2024 15:04:30 +0000 (16:04 +0100)
commit894b00a3350c560990638bdf89bdf1f3d5491950
tree67540d8ad3639ab5efb69432706edfe7026be5d8
parent7aed6a2c51ffc97a126e0ea0c270fab7af97ae18
kasan: Fix Software Tag-Based KASAN with GCC

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
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>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Fixes: 7b861a53e46b ("kasan: Bump required compiler version")
Link: https://lore.kernel.org/r/20241021120013.3209481-1-elver@google.com
Signed-off-by: Will Deacon <will@kernel.org>
include/linux/compiler-gcc.h