commit | 02c739c52dd9668fe187586b15e4a87307c7ff2b | [log] [tgz] |
---|---|---|
author | Kees Cook <keescook@chromium.org> | Tue Aug 07 14:18:36 2018 -0700 |
committer | Rishabh Bhatnagar <rishabhb@codeaurora.org> | Wed Nov 07 10:03:50 2018 -0800 |
tree | ecd9846ef5438ab271b19d0ee707ab57c877a63e | |
parent | e08156eb1450767b26b9890388b66b3108b06648 [diff] [blame] |
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 Change-Id: Icd5510d1b12860ffcf91f3c981a7b87515c83c34 Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Git-Repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Git-Commit: d73d67fbcb94409e0a92952750f162d4eb696e96 Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
diff --git a/include/crypto/cbc.h b/include/crypto/cbc.h index f5b8bfc..3bf28bee 100644 --- a/include/crypto/cbc.h +++ b/include/crypto/cbc.h
@@ -113,7 +113,7 @@ 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;