Thread (25 messages) 25 messages, 4 authors, 2023-09-14

Re: [PATCH net 2/5] tls: fix use-after-free with partial reads and async decrypt

flat view

From: Jakub Kicinski <kuba@kernel.org>
Date: 2023-09-07 02:05:30

On Wed,  6 Sep 2023 19:08:32 +0200 Sabrina Dubroca wrote:
quoted hunk ↗ jump to hunk
@@ -221,7 +222,8 @@ static void tls_decrypt_done(void *data, int err)
	/* Free the destination pages if skb was not decrypted inplace */
	if (sgout != sgin) {
This check is always true now, right?
Should we replace it with dctx->put_outsg?
		/* Skip the first S/G entry as it points to AAD */
 		for_each_sg(sg_next(sgout), sg, UINT_MAX, pages) {
 			if (!sg)
 				break;
-			put_page(sg_page(sg));
+			if (dctx->put_outsg)
+				put_page(sg_page(sg));
 		}
 	}
-- 
pw-bot: cr
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help