From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A215D2745E; Fri, 21 Nov 2025 13:31:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763731903; cv=none; b=IDcQEZWp6rzBV6oVPd07KRr4qRSNqJt49ANxTAi/I+3znydiW81SN+iahTOaP8mGziaOVE3lTVs+shjxBFd+I/Je558BUL96sULeAQOXFdeIrW3RXNTefakvbnMjhvea0AbI8pzhFB8y5hcH3+fQs417nDIcAVrzZJN4TL+YnBM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763731903; c=relaxed/simple; bh=N8jQ19O1CNSPF//XgtmbUWKhWGjiYduwcKF+3Oh7nJc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IHnkjsJJPrbmDDnuN7tTzpL++FofIp/ZnvVv3HoxcWj2cZbk2LcWShEiw3iSbYhD/PTYL3u98VS6UhiwcDlbzUWyvsGSqC7e1WmzLi1DtiRtLiTG0a2Lgjs8oYbdGQScP3WC3lGtDcVl55WkyttqcRHERKA007FKDLigwWSYXEQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NS+P6Ijr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NS+P6Ijr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E6C1C4CEF1; Fri, 21 Nov 2025 13:31:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1763731903; bh=N8jQ19O1CNSPF//XgtmbUWKhWGjiYduwcKF+3Oh7nJc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NS+P6Ijrm37nkMI5FBcSEU5J99jl6sQKrnARH13L9yulJVbXtDuHeWM0ENS9d47bN QXX86z6qQR27eVWG+bK7e9B9veKO/RcphfcD8nozg43HWlxnq5OwtH+zJLMHfGn5Lr ED6gLsp8wQ9zledqj0ssIivreyKi1o6xf9tkBy1M= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ard Biesheuvel , Eric Biggers , Sasha Levin Subject: [PATCH 6.12 088/185] lib/crypto: arm/curve25519: Disable on CPU_BIG_ENDIAN Date: Fri, 21 Nov 2025 14:11:55 +0100 Message-ID: <20251121130147.043287418@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121130143.857798067@linuxfoundation.org> References: <20251121130143.857798067@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: 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 Link: https://lore.kernel.org/r/20251104054906.716914-1-ebiggers@kernel.org Signed-off-by: Eric Biggers Signed-off-by: Sasha Levin --- 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 f87e63b2212eb..df2ae5c6af953 100644 --- a/arch/arm/crypto/Kconfig +++ b/arch/arm/crypto/Kconfig @@ -4,7 +4,7 @@ menu "Accelerated Cryptographic Algorithms for CPU (arm)" config CRYPTO_CURVE25519_NEON tristate - depends on KERNEL_MODE_NEON + depends on KERNEL_MODE_NEON && !CPU_BIG_ENDIAN select CRYPTO_KPP select CRYPTO_LIB_CURVE25519_GENERIC select CRYPTO_ARCH_HAVE_LIB_CURVE25519 -- 2.51.0