linux/lib/crypto
Jason A. Donenfeld c9cc0517bb crypto: chacha20poly1305 - prevent integer overflow on large input
This code assigns src_len (size_t) to sl (int), which causes problems
when src_len is very large. Probably nobody in the kernel should be
passing this much data to chacha20poly1305 all in one go anyway, so I
don't think we need to change the algorithm or introduce larger types
or anything. But we should at least error out early in this case and
print a warning so that we get reports if this does happen and can look
into why anybody is possibly passing it that much data or if they're
accidently passing -1 or similar.

Fixes: d95312a3cc ("crypto: lib/chacha20poly1305 - reimplement crypt_from_sg() routine")
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: stable@vger.kernel.org # 5.5+
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2020-02-14 14:48:37 +08:00
..
aes.c
arc4.c
blake2s-generic.c
blake2s-selftest.c
blake2s.c
chacha20poly1305-selftest.c crypto: chacha20poly1305 - add back missing test vectors and test chunking 2020-01-22 16:21:11 +08:00
chacha20poly1305.c crypto: chacha20poly1305 - prevent integer overflow on large input 2020-02-14 14:48:37 +08:00
chacha.c
curve25519-fiat32.c crypto: lib/curve25519 - work around Clang stack spilling issue 2019-11-17 09:02:43 +08:00
curve25519-generic.c crypto: curve25519 - Fix selftest build error 2020-01-16 15:18:13 +08:00
curve25519-hacl64.c crypto: curve25519 - generic C library implementations 2019-11-17 09:02:43 +08:00
curve25519-selftest.c crypto: lib/curve25519 - re-add selftests 2019-12-27 18:18:03 +08:00
curve25519.c crypto: curve25519 - Fix selftest build error 2020-01-16 15:18:13 +08:00
des.c
Kconfig crypto: x86/poly1305 - wire up faster implementations for kernel 2020-01-16 15:18:12 +08:00
libchacha.c
Makefile crypto: curve25519 - Fix selftest build error 2020-01-16 15:18:13 +08:00
poly1305-donna32.c crypto: poly1305 - add new 32 and 64-bit generic versions 2020-01-16 15:18:12 +08:00
poly1305-donna64.c crypto: poly1305 - add new 32 and 64-bit generic versions 2020-01-16 15:18:12 +08:00
poly1305.c crypto: poly1305 - add new 32 and 64-bit generic versions 2020-01-16 15:18:12 +08:00
sha256.c