crypto: algif_aead - fix for multiple operations on AF_ALG sockets
authorLars Persson <lars.persson@axis.com>
Tue, 25 Aug 2015 09:59:15 +0000 (11:59 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 25 Aug 2015 13:13:20 +0000 (21:13 +0800)
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 <larper@axis.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algif_aead.c

index 38a6cab7aecacd308066ba40dcdae95ae6d5c6e0..0aa6fdfb448a8c4081e06aa9dcb041433dc280a5 100644 (file)
@@ -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;