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 62426308F1C for ; Fri, 15 Aug 2025 16:10:09 +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=1755274209; cv=none; b=fW1ZF1cilEOaG7WLGQ2d2X7IuYTpOAlwbtysznn3b2MFccYV5x3O5FstW99P4KN8rC8btG5OXP+XxJpwOn86/ajm/yJViMtjaBZy/dkqCuRHqqeZNe+pc0OzF4I+YOq5tujhU/tsI0zqnjxtfGseciLf87v9mKtE3eg7QkwSsNI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755274209; c=relaxed/simple; bh=/7v9Nr4qBuhjs+xXPj18OR4ctw3LeODIR2yGkfH43IQ=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=Ox4WGHRC7sTaKqr55j2K2fbouKehsBIx2DrOu26ENylfde3qnCFZmgV0u9Hqq4Zv9fvGKlossSeEe7Tk5aNTezuHVC68Z4GDI6EvrKA3dQgu/pd42rvNcIY/eLJXNLzMf2KGyfSlMJ7FK4TnXIwzWs16dwd40cjQqxpB19rBHmI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=gvbzMfAM; 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="gvbzMfAM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C68F3C4CEEB; Fri, 15 Aug 2025 16:10:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755274209; bh=/7v9Nr4qBuhjs+xXPj18OR4ctw3LeODIR2yGkfH43IQ=; h=Subject:To:Cc:From:Date:From; b=gvbzMfAM7LMsh6r+Ne+MBhmIM4C0kBRl/26ILVFP29pCacl22f8iaI2sc2RUSQwdx RDKMPw+tZg6+Unp6ykG48cSR0bI6xZExAmpXOKLvuUItQQH8UMrZ0zVw6WX2vYLl6s a8Ru9B4ZWAMJq/FeIiJQzpgHJ+vMR7e41KdeZ0oA= Subject: FAILED: patch "[PATCH] lib/crypto: arm64/poly1305: Fix register corruption in" failed to apply to 6.6-stable tree To: ebiggers@kernel.org,ardb@kernel.org Cc: From: Date: Fri, 15 Aug 2025 18:09:57 +0200 Message-ID: <2025081557-sinless-cleat-22ee@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y git checkout FETCH_HEAD git cherry-pick -x eec76ea5a7213c48529a46eed1b343e5cee3aaab # git commit -s git send-email --to '' --in-reply-to '2025081557-sinless-cleat-22ee@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From eec76ea5a7213c48529a46eed1b343e5cee3aaab Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 6 Jul 2025 16:10:58 -0700 Subject: [PATCH] lib/crypto: arm64/poly1305: Fix register corruption in no-SIMD contexts Restore the SIMD usability check that was removed by commit a59e5468a921 ("crypto: arm64/poly1305 - Add block-only interface"). This safety check is cheap and is well worth eliminating a footgun. While the Poly1305 functions should not be called when SIMD registers are unusable, if they are anyway, they should just do the right thing instead of corrupting random tasks' registers and/or computing incorrect MACs. Fixing this is also needed for poly1305_kunit to pass. Just use may_use_simd() instead of the original crypto_simd_usable(), since poly1305_kunit won't rely on crypto_simd_disabled_for_test. Fixes: a59e5468a921 ("crypto: arm64/poly1305 - Add block-only interface") Cc: stable@vger.kernel.org Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20250706231100.176113-4-ebiggers@kernel.org Signed-off-by: Eric Biggers diff --git a/lib/crypto/arm64/poly1305-glue.c b/lib/crypto/arm64/poly1305-glue.c index c9a74766785b..31aea21ce42f 100644 --- a/lib/crypto/arm64/poly1305-glue.c +++ b/lib/crypto/arm64/poly1305-glue.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -33,7 +34,7 @@ void poly1305_blocks_arch(struct poly1305_block_state *state, const u8 *src, unsigned int len, u32 padbit) { len = round_down(len, POLY1305_BLOCK_SIZE); - if (static_branch_likely(&have_neon)) { + if (static_branch_likely(&have_neon) && likely(may_use_simd())) { do { unsigned int todo = min_t(unsigned int, len, SZ_4K);