Skip to content

Commit 0567fc9

Browse files
ebiggersherbertx
authored andcommitted
crypto: skcipher - fix aligning block size in skcipher_copy_iv()
The ALIGN() macro needs to be passed the alignment, not the alignmask (which is the alignment minus 1). Fixes: b286d8b ("crypto: skcipher - Add skcipher walk interface") Cc: <stable@vger.kernel.org> # v4.10+ Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent e4a1f78 commit 0567fc9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎crypto/skcipher.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ static int skcipher_copy_iv(struct skcipher_walk *walk)
398398
unsigned size;
399399
u8 *iv;
400400

401-
aligned_bs = ALIGN(bs, alignmask);
401+
aligned_bs = ALIGN(bs, alignmask + 1);
402402

403403
/* Minimum size to align buffer by alignmask. */
404404
size = alignmask & ~a;

0 commit comments

Comments
 (0)