crypto: algif_skcipher - Load TX SG list after waiting
Subsystems (2)
PATCH 1/1 crypto: algif_skcipher - Load TX SG list after waiting
From: Herbert Xu <[email protected]>
commit 4f0414e54e4d1893c6f08260693f8ef84c929293 upstream.
We need to load the TX SG list in sendmsg(2) after waiting for incoming data, not before.
[[email protected]: backport to 3.18, where the relevant logic is located in skcipher_recvmsg() rather than skcipher_recvmsg_sync()]
Reported-by Dmitry Vyukov <[email protected]>
Signed-off-by Herbert Xu <[email protected]>
Tested-by Dmitry Vyukov <[email protected]>
Signed-off-by Connor O'Brien <[email protected]>
--- crypto/algif_skcipher.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
crypto/algif_skcipher.c +7 -7
@@ -448,13 +448,6 @@ static int skcipher_recvmsg(struct kiocb *unused, struct socket *sock,char __user *from = iov->iov_base;while (seglen) { - sgl =list_first_entry (&ctx->tsgl, - struct skcipher_sg_list, list); - sg = sgl->sg; - -while (!sg->length) - sg++; - used = ctx->used;if (!used) { err =skcipher_wait_for_data (sk, flags);
@@ -476,6 +469,13 @@ static int skcipher_recvmsg(struct kiocb *unused, struct socket *sock,if (!used) goto free; + sgl =list_first_entry (&ctx->tsgl, + struct skcipher_sg_list, list); + sg = sgl->sg; + +while (!sg->length) + sg++; +ablkcipher_request_set_crypt (&ctx->req, sg, ctx->rsgl.sg, used, ctx->iv);
Signature · 1 line
2.14.2.920.gcf0c67979c-goog
Quoted 9 lines · Connor O'Brien
From: Herbert Xu <[email protected]>
commit
4f0414e54e4d1893c6f08260693f8ef84c929293upstream.We need to load the TX SG list in sendmsg(2) after waiting for incoming data, not before.
[[email protected]: backport to 3.18, where the relevant logic is located in
skcipher_recvmsg()rather thanskcipher_recvmsg_sync()]
thanks for the backport, now queued up.
greg k-h