diff options
author | Kees Cook <keescook@chromium.org> | 2018-08-07 17:18:36 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-09-03 23:35:03 -0400 |
commit | d73d67fbcb94409e0a92952750f162d4eb696e96 (patch) | |
tree | e5a3f40467761338110ae7a46950457ee1a3a823 | |
parent | 3bdd23f886c08a0d649c535e1e2cf083ec600036 (diff) |
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>
-rw-r--r-- | include/crypto/cbc.h | 2 |
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( | |||
113 | unsigned int bsize = crypto_skcipher_blocksize(tfm); | 113 | unsigned int bsize = crypto_skcipher_blocksize(tfm); |
114 | unsigned int nbytes = walk->nbytes; | 114 | unsigned int nbytes = walk->nbytes; |
115 | u8 *src = walk->src.virt.addr; | 115 | u8 *src = walk->src.virt.addr; |
116 | u8 last_iv[bsize]; | 116 | u8 last_iv[MAX_CIPHER_BLOCKSIZE]; |
117 | 117 | ||
118 | /* Start of the last block. */ | 118 | /* Start of the last block. */ |
119 | src += nbytes - (nbytes & (bsize - 1)) - bsize; | 119 | src += nbytes - (nbytes & (bsize - 1)) - bsize; |