crypto: AF_ALG - update correct dst SGL entry
PATCH 1/1 crypto: AF_ALG - update correct dst SGL entry
When two adjacent TX SGL are processed and parts of both TX SGLs are pulled into the per-request TX SGL, the wrong per-request TX SGL entries were updated.
This fixes a NULL pointer dereference when a cipher implementation walks the TX SGL where some of the SGL entries were NULL.
--- crypto/af_alg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
crypto/af_alg.c +2 -2
@@ -619,14 +619,14 @@ void af_alg_pull_tsgl(struct sock *sk, size_t used, struct scatterlist *dst,struct af_alg_ctx *ctx = ask->private;struct af_alg_tsgl *sgl;struct scatterlist *sg; -unsigned int i, j; +unsigned int i, j =0 ;while (!list_empty (&ctx->tsgl_list)) { sgl = list_first_entry(&ctx->tsgl_list, struct af_alg_tsgl, list); sg = sgl->sg; -for (i =0 , j =0 ; i < sgl->cur; i++) { +for (i =0 ; i < sgl->cur; i++) {size_t plen =min_t (size_t, used, sg[i].length);struct page *page =sg_page (sg + i);
Signature · 1 line
2.13.5
Herbert Xu
maintainerQuoted 8 lines · Stephan Müller
When two adjacent TX SGL are processed and parts of both TX SGLs are pulled into the per-request TX SGL, the wrong per-request TX SGL entries were updated.
This fixes a NULL pointer dereference when a cipher implementation walks the TX SGL where some of the SGL entries were NULL.
Signed-off-by Stephan Mueller <[email protected]>
Oops, looks like you already sent me this fix. It should have this fixes header:
Cheers,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Herbert Xu
maintainerQuoted 8 lines · Stephan Müller
When two adjacent TX SGL are processed and parts of both TX SGLs are pulled into the per-request TX SGL, the wrong per-request TX SGL entries were updated.
This fixes a NULL pointer dereference when a cipher implementation walks the TX SGL where some of the SGL entries were NULL.
Signed-off-by Stephan Mueller <[email protected]>
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt