Эх сурвалжийг харах

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>
Lars Persson 10 жил өмнө
parent
commit
bf433416e6
1 өөрчлөгдсөн 1 нэмэгдсэн , 0 устгасан
  1. 1 0
      crypto/algif_aead.c

+ 1 - 0
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;