Thread (2 messages) 2 messages, 2 authors, 2018-12-11

Re: [PATCH] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2018-12-11 09:26:18
Also in: linuxppc-dev, lkml

On Tue, Dec 11, 2018 at 07:29:40AM +0000, Christophe Leroy wrote:
quoted hunk ↗ jump to hunk
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 6988012deca4..385ec970b639 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -1668,8 +1668,11 @@ static struct talitos_edesc *ablkcipher_edesc_alloc(struct ablkcipher_request *
 	struct talitos_ctx *ctx = crypto_ablkcipher_ctx(cipher);
 	unsigned int ivsize = crypto_ablkcipher_ivsize(cipher);
 
+	if (ivsize)
+		memcpy(ctx->iv, areq->info, ivsize);
The ctx is per-tfm, not per-request.  So you cannot write to it.
This needs to go into a pre-request area.
 	return talitos_edesc_alloc(ctx->dev, areq->src, areq->dst,
-				   areq->info, 0, areq->nbytes, 0, ivsize, 0,
+				   ctx->iv, 0, areq->nbytes, 0, ivsize, 0,
 				   areq->base.flags, encrypt);
 }
Thanks,
-- 
Email: Herbert Xu [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help