]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
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)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 26 Feb 2017 05:34:21 +0000 (21:34 -0800)
Orabug: 25243093

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>
(cherry picked from commit bf433416e67597ba105ece55b3136557874945db)
Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
crypto/algif_aead.c

index 69abada22373f54b5dd434ba514e9c6c80c180e5..d0cac026d2dd3dc880ef274749ee6b5a386b9487 100644 (file)
@@ -89,6 +89,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;