]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: x86/aegis128 - access 32-bit arguments as 32-bit
authorEric Biggers <ebiggers@google.com>
Thu, 17 Oct 2024 00:00:42 +0000 (17:00 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:51:13 +0000 (19:51 +0100)
commita304c141221047da2ac4ef9527cfae97df726970
tree67b469383bbf0fb5fbe152f6b92cf1355704365e
parentdc0c28b7f98f8f0cc3221c69b2498ebdc1807483
crypto: x86/aegis128 - access 32-bit arguments as 32-bit

commit 3b2f2d22fb424e9bebda4dbf6676cbfc7f9f62cd upstream.

Fix the AEGIS assembly code to access 'unsigned int' arguments as 32-bit
values instead of 64-bit, since the upper bits of the corresponding
64-bit registers are not guaranteed to be zero.

Note: there haven't been any reports of this bug actually causing
incorrect behavior.  Neither gcc nor clang guarantee zero-extension to
64 bits, but zero-extension is likely to happen in practice because most
instructions that operate on 32-bit registers zero-extend to 64 bits.

Fixes: 1d373d4e8e15 ("crypto: x86 - Add optimized AEGIS implementations")
Cc: stable@vger.kernel.org
Reviewed-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/crypto/aegis128-aesni-asm.S