Skip to content

Commit d73d67f

Browse files
keesherbertx
authored andcommitted
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 <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 3bdd23f commit d73d67f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/crypto/cbc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static inline int crypto_cbc_decrypt_inplace(
113113
unsigned int bsize = crypto_skcipher_blocksize(tfm);
114114
unsigned int nbytes = walk->nbytes;
115115
u8 *src = walk->src.virt.addr;
116-
u8 last_iv[bsize];
116+
u8 last_iv[MAX_CIPHER_BLOCKSIZE];
117117

118118
/* Start of the last block. */
119119
src += nbytes - (nbytes & (bsize - 1)) - bsize;

0 commit comments

Comments
 (0)