linux-stable/arch/arm64/crypto
Ard Biesheuvel 1c0cf6d196 crypto: arm64/neonbs - fix out-of-bounds access on short input
The bit-sliced implementation of AES-CTR operates on blocks of 128
bytes, and will fall back to the plain NEON version for tail blocks or
inputs that are shorter than 128 bytes to begin with.

It will call straight into the plain NEON asm helper, which performs all
memory accesses in granules of 16 bytes (the size of a NEON register).
For this reason, the associated plain NEON glue code will copy inputs
shorter than 16 bytes into a temporary buffer, given that this is a rare
occurrence and it is not worth the effort to work around this in the asm
code.

The fallback from the bit-sliced NEON version fails to take this into
account, potentially resulting in out-of-bounds accesses. So clone the
same workaround, and use a temp buffer for short in/outputs.

Fixes: fc074e1300 ("crypto: arm64/aes-neonbs-ctr - fallback to plain NEON for final chunk")
Cc: <stable@vger.kernel.org>
Reported-by: syzbot+f1ceaa1a09ab891e1934@syzkaller.appspotmail.com
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2024-02-24 08:37:24 +08:00
..
.gitignore
aes-ce-ccm-core.S
aes-ce-ccm-glue.c
aes-ce-core.S
aes-ce-glue.c
aes-ce-setkey.h
aes-ce.S
aes-cipher-core.S
aes-cipher-glue.c
aes-glue-ce.c
aes-glue-neon.c
aes-glue.c
aes-modes.S
aes-neon.S
aes-neonbs-core.S
aes-neonbs-glue.c crypto: arm64/neonbs - fix out-of-bounds access on short input 2024-02-24 08:37:24 +08:00
chacha-neon-core.S
chacha-neon-glue.c
crct10dif-ce-core.S
crct10dif-ce-glue.c
ghash-ce-core.S
ghash-ce-glue.c
Kconfig crypto: arm64/sm4 - Remove cfb(sm4) 2023-12-08 11:59:45 +08:00
Makefile
nh-neon-core.S
nhpoly1305-neon-glue.c
poly1305-armv8.pl
poly1305-glue.c
polyval-ce-core.S
polyval-ce-glue.c
sha1-ce-core.S crypto: arm64/sha1-ce - clean up backwards function names 2023-10-20 13:39:25 +08:00
sha1-ce-glue.c crypto: arm64/sha1-ce - clean up backwards function names 2023-10-20 13:39:25 +08:00
sha2-ce-core.S crypto: arm64/sha2-ce - clean up backwards function names 2023-10-20 13:39:25 +08:00
sha2-ce-glue.c crypto: arm64/sha2-ce - clean up backwards function names 2023-10-20 13:39:25 +08:00
sha3-ce-core.S
sha3-ce-glue.c
sha256-glue.c crypto: arm64/sha256 - clean up backwards function names 2023-10-20 13:39:26 +08:00
sha512-armv8.pl
sha512-ce-core.S crypto: arm64/sha512-ce - clean up backwards function names 2023-10-20 13:39:25 +08:00
sha512-ce-glue.c crypto: arm64/sha512-ce - clean up backwards function names 2023-10-20 13:39:25 +08:00
sha512-glue.c crypto: arm64/sha512 - clean up backwards function names 2023-10-20 13:39:26 +08:00
sm3-ce-core.S
sm3-ce-glue.c
sm3-neon-core.S
sm3-neon-glue.c
sm4-ce-asm.h
sm4-ce-ccm-core.S
sm4-ce-ccm-glue.c
sm4-ce-cipher-core.S
sm4-ce-cipher-glue.c
sm4-ce-core.S crypto: arm64/sm4 - Remove cfb(sm4) 2023-12-08 11:59:45 +08:00
sm4-ce-gcm-core.S
sm4-ce-gcm-glue.c
sm4-ce-glue.c crypto: arm64/sm4 - Remove cfb(sm4) 2023-12-08 11:59:45 +08:00
sm4-ce.h crypto: arm64/sm4 - Remove cfb(sm4) 2023-12-08 11:59:45 +08:00
sm4-neon-core.S crypto: arm64/sm4 - Remove cfb(sm4) 2023-12-08 11:59:45 +08:00
sm4-neon-glue.c crypto: arm64/sm4 - Remove cfb(sm4) 2023-12-08 11:59:45 +08:00