summaryrefslogtreecommitdiff
path: root/crypto/algif_aead.c
diff options
context:
space:
mode:
authorLars Persson <lars.persson@axis.com>2015-08-25 11:59:15 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2015-08-25 21:13:20 +0800
commit97fc4b451d1e513c0b6a5296a584a3b18afeb8d7 (patch)
tree816c5f31dcac9b3c5418f9337aae4e1bc772a15b /crypto/algif_aead.c
parent827566a3d3c95e5d220851075201de449d82df8d (diff)
downloadlinux-crypto-97fc4b451d1e513c0b6a5296a584a3b18afeb8d7.tar.gz
linux-crypto-97fc4b451d1e513c0b6a5296a584a3b18afeb8d7.zip
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 <larper@axis.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/algif_aead.c')
-rw-r--r--crypto/algif_aead.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c
index 38a6cab7..0aa6fdfb 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;