]> www.infradead.org Git - users/dwmw2/linux.git/commit
crypto: x86/crc32c - access 32-bit arguments as 32-bit
authorEric Biggers <ebiggers@google.com>
Mon, 14 Oct 2024 04:24:46 +0000 (21:24 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 26 Oct 2024 06:41:59 +0000 (14:41 +0800)
commiteebcadfa21e66a893846ec168fb7c26a46a510cd
treef094ac6a39dc594d45fb5d7f013b82d430fca9ed
parent84ebf9dbe652355461b3e2f4693ce7b7402c30ca
crypto: x86/crc32c - access 32-bit arguments as 32-bit

Fix crc32c-pcl-intel-asm_64.S to access 32-bit 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.  Also update the type of
the length argument to be unsigned int rather than int, as the assembly
code treats it as unsigned.

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.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/crc32c-intel_glue.c
arch/x86/crypto/crc32c-pcl-intel-asm_64.S