X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=crypto%2Fcipher.c;h=65bcea0cd17c867ae88dde90aefc9e137ebd3259;hb=8fa29b23d9e0ef976dc578aab98297d4f24f70da;hp=dfd4bcfc59758332d8ae82fc1d0db2e009c9b26a;hpb=d344c5e0856ad03278d8700b503762dbc8b86e12;p=linux-2.6 diff --git a/crypto/cipher.c b/crypto/cipher.c index dfd4bcfc59..65bcea0cd1 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;