diff mbox

crypto: aead - fix for multiple operations on AF_ALG sockets

Message ID 1440496755-15105-1-git-send-email-larper@axis.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Lars Persson Aug. 25, 2015, 9:59 a.m. UTC
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>
---
 crypto/algif_aead.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Herbert Xu Aug. 25, 2015, 1:16 p.m. UTC | #1
On Tue, Aug 25, 2015 at 11:59:15AM +0200, Lars Persson wrote:
> 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>

Applied.
diff mbox

Patch

diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c
index 38a6cab..0aa6fdf 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;