Commit bf433416 authored by Lars Persson's avatar Lars Persson Committed by Herbert Xu

crypto: algif_aead - fix for multiple operations on AF_ALG sockets

The tsgl scatterlist must be re-initialized after each
operation. Otherwise the sticky bits in the page_link will corrupt the
list with pre-mature termination or false chaining.
Signed-off-by: default avatarLars Persson <larper@axis.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent df9e21e1
...@@ -90,6 +90,7 @@ static void aead_put_sgl(struct sock *sk) ...@@ -90,6 +90,7 @@ static void aead_put_sgl(struct sock *sk)
put_page(sg_page(sg + i)); put_page(sg_page(sg + i));
sg_assign_page(sg + i, NULL); sg_assign_page(sg + i, NULL);
} }
sg_init_table(sg, ALG_MAX_PAGES);
sgl->cur = 0; sgl->cur = 0;
ctx->used = 0; ctx->used = 0;
ctx->more = 0; ctx->more = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment