From: Lars Persson Date: Tue, 25 Aug 2015 09:59:15 +0000 (+0200) Subject: crypto: algif_aead - fix for multiple operations on AF_ALG sockets X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4.2.0-rc1-256134-gbf433416e675;p=linux-beck.git 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: Lars Persson Signed-off-by: Herbert Xu --- diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c index 38a6cab7aeca..0aa6fdfb448a 100644 --- a/crypto/algif_aead.c +++ b/crypto/algif_aead.c @@ -90,6 +90,7 @@ static void aead_put_sgl(struct sock *sk) put_page(sg_page(sg + i)); sg_assign_page(sg + i, NULL); } + sg_init_table(sg, ALG_MAX_PAGES); sgl->cur = 0; ctx->used = 0; ctx->more = 0;