summaryrefslogtreecommitdiffstats
path: root/include/crypto
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2018-08-07 14:18:36 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2018-09-04 11:35:03 +0800
commitd73d67fbcb94409e0a92952750f162d4eb696e96 (patch)
treee5a3f40467761338110ae7a46950457ee1a3a823 /include/crypto
parent3bdd23f886c08a0d649c535e1e2cf083ec600036 (diff)
downloadlinux-d73d67fbcb94409e0a92952750f162d4eb696e96.tar.bz2
crypto: cbc - Remove VLA usage
In the quest to remove all stack VLA usage from the kernel[1], this uses the upper bounds on blocksize. Since this is always a cipher blocksize, use the existing cipher max blocksize. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto')
-rw-r--r--include/crypto/cbc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/crypto/cbc.h b/include/crypto/cbc.h
index f5b8bfc22e6d..3bf28beefa33 100644
--- a/include/crypto/cbc.h
+++ b/include/crypto/cbc.h
@@ -113,7 +113,7 @@ static inline int crypto_cbc_decrypt_inplace(
unsigned int bsize = crypto_skcipher_blocksize(tfm);
unsigned int nbytes = walk->nbytes;
u8 *src = walk->src.virt.addr;
- u8 last_iv[bsize];
+ u8 last_iv[MAX_CIPHER_BLOCKSIZE];
/* Start of the last block. */
src += nbytes - (nbytes & (bsize - 1)) - bsize;