Thread (2 messages) 2 messages, 2 authors, 2022-03-03

Re: [PATCH] net/sctp: use memset avoid infoleaks

From: Jakub Kicinski <kuba@kernel.org>
Date: 2022-03-03 06:18:49
Also in: linux-sctp, lkml

On Tue,  1 Mar 2022 08:18:55 +0000 cgel.zte@gmail.com wrote:
From: Minghao Chi (CGEL ZTE) <redacted>

Use memset to initialize structs to preventing infoleaks
in sctp_auth_chunk_verify
Please explain where it's leaked to. Looks like a parameter structure
that's used by the called but not copied anywhere.
quoted hunk ↗ jump to hunk
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index cc544a97c4af..7ff16d12e0c5 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -652,6 +652,7 @@ static bool sctp_auth_chunk_verify(struct net *net, struct sctp_chunk *chunk,
 		return false;
 
 	/* set-up our fake chunk so that we can process it */
+	memset(&auth, 0x0, sizeof(auth));
 	auth.skb = chunk->auth_chunk;
 	auth.asoc = chunk->asoc;
 	auth.sctp_hdr = chunk->sctp_hdr;
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help