Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 2d97591ef43d ("crypto: af_alg - consolidation of...")
Cc: <stable@vger.kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

+1 -5
+1 -5
crypto/algif_skcipher.c
··· 74 74 return PTR_ERR(areq); 75 75 76 76 /* 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); 78 78 if (err) 79 79 goto free; 80 - 81 - /* Process only as much RX buffers for which we have TX data */ 82 - if (len > ctx->used) 83 - len = ctx->used; 84 80 85 81 /* 86 82 * If more buffers are to be expected to be processed, process only