X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=crypto%2Fcipher.c;h=65bcea0cd17c867ae88dde90aefc9e137ebd3259;hb=63e8d9114dab88c101be2372cb1f83a4fe74d9c1;hp=dfd4bcfc59758332d8ae82fc1d0db2e009c9b26a;hpb=9fe66dfd8846706ff11ed7990d06c92644973bd8;p=firefly-linux-kernel-4.4.55.git 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, struct crypto_tfm *tfm = desc->tfm; void (*xor)(u8 *, const u8 *) = tfm->crt_u.cipher.cit_xor_block; int bsize = crypto_tfm_alg_blocksize(tfm); + unsigned long alignmask = crypto_tfm_alg_alignmask(desc->tfm); - u8 stack[src == dst ? bsize : 0]; - u8 *buf = stack; + u8 stack[src == dst ? bsize + alignmask : 0]; + u8 *buf = (u8 *)ALIGN((unsigned long)stack, alignmask + 1); u8 **dst_p = src == dst ? &buf : &dst; void (*fn)(void *, u8 *, const u8 *) = desc->crfn;