Thread (24 messages) flat view 24 messages, 3 authors, 2018-08-18
STALE2943d

[PATCH 4.17 17/21] crypto: skcipher - fix aligning block size in skcipher_copy_iv()

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2018-08-16 18:47:20
Also in: lkml

4.17-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Biggers <redacted>

commit 0567fc9e90b9b1c8dbce8a5468758e6206744d4a upstream.

The ALIGN() macro needs to be passed the alignment, not the alignmask
(which is the alignment minus 1).

Fixes: b286d8b1a690 ("crypto: skcipher - Add skcipher walk interface")
Cc: <redacted> # v4.10+
Signed-off-by: Eric Biggers <redacted>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 crypto/skcipher.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/crypto/skcipher.c
+++ b/crypto/skcipher.c
@@ -399,7 +399,7 @@ static int skcipher_copy_iv(struct skcip
 	unsigned size;
 	u8 *iv;
 
-	aligned_bs = ALIGN(bs, alignmask);
+	aligned_bs = ALIGN(bs, alignmask + 1);
 
 	/* Minimum size to align buffer by alignmask. */
 	size = alignmask & ~a;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help