Skip to contentSkip to conversation

crypto: aead - fix for multiple operations on AF_ALG sockets

PATCH Applied Lars Persson 2 participants 2 messages Aug 25, 2015 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: 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.

---
 crypto/algif_aead.c | 1 +
 1 file changed, 1 insertion(+)
crypto/algif_aead.c +1 -0
index 38a6cab..0aa6fdf 100644
@@ -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;
Signature · 1 line
2.1.4
maintainer Applied
#1 lore raw
Quoted 5 lines · Lars Persson

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.

Applied.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt