Skip to content

Commit

Permalink
crypto: algif_skcipher - Cap recv SG list at ctx->used
Browse files Browse the repository at this point in the history
Somewhere along the line the cap on the SG list length for receive
was lost.  This patch restores it and removes the subsequent test
which is now redundant.

Fixes: 2d97591 ("crypto: af_alg - consolidation of...")
Cc: <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Reviewed-by: Stephan Mueller <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
herbertx committed Jun 15, 2020
1 parent 9545926 commit 7cf8195
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions crypto/algif_skcipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,10 @@ static int _skcipher_recvmsg(struct socket *sock, struct msghdr *msg,
return PTR_ERR(areq);

/* convert iovecs of output buffers into RX SGL */
err = af_alg_get_rsgl(sk, msg, flags, areq, -1, &len);
err = af_alg_get_rsgl(sk, msg, flags, areq, ctx->used, &len);
if (err)
goto free;

/* Process only as much RX buffers for which we have TX data */
if (len > ctx->used)
len = ctx->used;

/*
* If more buffers are to be expected to be processed, process only
* full block size buffers.
Expand Down

0 comments on commit 7cf8195

Please sign in to comment.