Skip to content

Commit 7cf8195

Browse files
committed
crypto: algif_skcipher - Cap recv SG list at ctx->used
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]>
1 parent 9545926 commit 7cf8195

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

crypto/algif_skcipher.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,10 @@ static int _skcipher_recvmsg(struct socket *sock, struct msghdr *msg,
7474
return PTR_ERR(areq);
7575

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

81-
/* Process only as much RX buffers for which we have TX data */
82-
if (len > ctx->used)
83-
len = ctx->used;
84-
8581
/*
8682
* If more buffers are to be expected to be processed, process only
8783
* full block size buffers.

0 commit comments

Comments
 (0)