aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/cipher.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/cipher.c b/crypto/cipher.c
index dfd4bcfc5975..65bcea0cd17c 100644
--- a/crypto/cipher.c
+++ b/crypto/cipher.c
@@ -212,9 +212,10 @@ static unsigned int cbc_process_decrypt(const struct cipher_desc *desc,
212 struct crypto_tfm *tfm = desc->tfm; 212 struct crypto_tfm *tfm = desc->tfm;
213 void (*xor)(u8 *, const u8 *) = tfm->crt_u.cipher.cit_xor_block; 213 void (*xor)(u8 *, const u8 *) = tfm->crt_u.cipher.cit_xor_block;
214 int bsize = crypto_tfm_alg_blocksize(tfm); 214 int bsize = crypto_tfm_alg_blocksize(tfm);
215 unsigned long alignmask = crypto_tfm_alg_alignmask(desc->tfm);
215 216
216 u8 stack[src == dst ? bsize : 0]; 217 u8 stack[src == dst ? bsize + alignmask : 0];
217 u8 *buf = stack; 218 u8 *buf = (u8 *)ALIGN((unsigned long)stack, alignmask + 1);
218 u8 **dst_p = src == dst ? &buf : &dst; 219 u8 **dst_p = src == dst ? &buf : &dst;
219 220
220 void (*fn)(void *, u8 *, const u8 *) = desc->crfn; 221 void (*fn)(void *, u8 *, const u8 *) = desc->crfn;