linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5.15] lib/crypto: arm/curve25519: Disable on CPU_BIG_ENDIAN
@ 2025-11-11 20:29 Eric Biggers
  2025-11-17 14:40 ` Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Biggers @ 2025-11-11 20:29 UTC (permalink / raw)
  To: stable
  Cc: linux-crypto, linux-arm-kernel, Ard Biesheuvel,
	Jason A . Donenfeld, Herbert Xu, Eric Biggers

commit 44e8241c51f762aafa50ed116da68fd6ecdcc954 upstream.

On big endian arm kernels, the arm optimized Curve25519 code produces
incorrect outputs and fails the Curve25519 test.  This has been true
ever since this code was added.

It seems that hardly anyone (or even no one?) actually uses big endian
arm kernels.  But as long as they're ostensibly supported, we should
disable this code on them so that it's not accidentally used.

Note: for future-proofing, use !CPU_BIG_ENDIAN instead of
CPU_LITTLE_ENDIAN.  Both of these are arch-specific options that could
get removed in the future if big endian support gets dropped.

Fixes: d8f1308a025f ("crypto: arm/curve25519 - wire up NEON implementation")
Cc: stable@vger.kernel.org
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20251104054906.716914-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
---
 arch/arm/crypto/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/crypto/Kconfig b/arch/arm/crypto/Kconfig
index 149a5bd6b88c..d3d318df0e38 100644
--- a/arch/arm/crypto/Kconfig
+++ b/arch/arm/crypto/Kconfig
@@ -164,10 +164,10 @@ config CRYPTO_NHPOLY1305_NEON
 	depends on KERNEL_MODE_NEON
 	select CRYPTO_NHPOLY1305
 
 config CRYPTO_CURVE25519_NEON
 	tristate "NEON accelerated Curve25519 scalar multiplication library"
-	depends on KERNEL_MODE_NEON
+	depends on KERNEL_MODE_NEON && !CPU_BIG_ENDIAN
 	select CRYPTO_LIB_CURVE25519_GENERIC
 	select CRYPTO_ARCH_HAVE_LIB_CURVE25519
 
 endif

base-commit: cc5ec87693063acebb60f587e8a019ba9b94ae0e
-- 
2.51.2



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

* Re: [PATCH 5.15] lib/crypto: arm/curve25519: Disable on CPU_BIG_ENDIAN
  2025-11-11 20:29 [PATCH 5.15] lib/crypto: arm/curve25519: Disable on CPU_BIG_ENDIAN Eric Biggers
@ 2025-11-17 14:40 ` Sasha Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2025-11-17 14:40 UTC (permalink / raw)
  To: Eric Biggers
  Cc: stable, linux-crypto, linux-arm-kernel, Ard Biesheuvel,
	Jason A . Donenfeld, Herbert Xu

Subject: lib/crypto: arm/curve25519: Disable on CPU_BIG_ENDIAN
Queue: 5.15

Thanks for the backport!


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

end of thread, other threads:[~2025-11-17 14:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-11 20:29 [PATCH 5.15] lib/crypto: arm/curve25519: Disable on CPU_BIG_ENDIAN Eric Biggers
2025-11-17 14:40 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).