]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
lib/crypto: curve25519-hacl64: Fix older clang KASAN workaround for GCC
authorNathan Chancellor <nathan@kernel.org>
Mon, 3 Nov 2025 19:11:24 +0000 (12:11 -0700)
committerEric Biggers <ebiggers@kernel.org>
Tue, 4 Nov 2025 17:35:58 +0000 (09:35 -0800)
Commit 2f13daee2a72 ("lib/crypto/curve25519-hacl64: Disable KASAN with
clang-17 and older") inadvertently disabled KASAN in curve25519-hacl64.o
for GCC unconditionally because clang-min-version will always evaluate
to nothing for GCC. Add a check for CONFIG_CC_IS_CLANG to avoid applying
the workaround for GCC, which is only needed for clang-17 and older.

Cc: stable@vger.kernel.org
Fixes: 2f13daee2a72 ("lib/crypto/curve25519-hacl64: Disable KASAN with clang-17 and older")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20251103-curve25519-hacl64-fix-kasan-workaround-v2-1-ab581cbd8035@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
lib/crypto/Makefile

index bded351aeacef2745d5e4d7c9d47edd188f79646..d2845b21458581610a8105eb7ad43d242c708f0a 100644 (file)
@@ -90,7 +90,7 @@ else
 libcurve25519-$(CONFIG_CRYPTO_LIB_CURVE25519_GENERIC) += curve25519-fiat32.o
 endif
 # clang versions prior to 18 may blow out the stack with KASAN
-ifeq ($(call clang-min-version, 180000),)
+ifeq ($(CONFIG_CC_IS_CLANG)_$(call clang-min-version, 180000),y_)
 KASAN_SANITIZE_curve25519-hacl64.o := n
 endif