Skip to contentSkip to conversation

sctp: fix potential panics in the SCTP-AUTH API.

PATCH Applied Vlad Yasevich 2 participants 2 messages Aug 21, 2008 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 sctp: fix potential panics in the SCTP-AUTH API.

Andrew, David

This problem is not limited to only the reported socket option. Most of the AUTH socket options suffer the same or similar issues. Here is a patch that fixes all the issues I saw the the API. The new tests for this API have been created and all of them have passed.

-vlad

sctp: fix potential panics in the SCTP-AUTH API.

All of the SCTP-AUTH socket options could cause a panic if the extension is disabled and the API is envoked.

Additionally, there were some additional assumptions that certain pointers would always be valid which may not always be the case.

This patch hardens the API and address all of the crash scenarios.

---
 net/sctp/endpointola.c |    4 +-
 net/sctp/socket.c      |   85 ++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 67 insertions(+), 22 deletions(-)
net/sctp/endpointola.c +2 -2
index e39a0cd..466eb75 100644
@@ -103,6 +103,7 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
 
 		/* Initialize the CHUNKS parameter */
 		auth_chunks->param_hdr.type = SCTP_PARAM_CHUNKS;
+		auth_chunks->param_hdr.length = htons(sizeof(sctp_paramhdr_t));
 
 		/* If the Add-IP functionality is enabled, we must
 		 * authenticate, ASCONF and ASCONF-ACK chunks
@@ -110,8 +111,7 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
 		if (sctp_addip_enable) {
 			auth_chunks->chunks[0] = SCTP_CID_ASCONF;
 			auth_chunks->chunks[1] = SCTP_CID_ASCONF_ACK;
-			auth_chunks->param_hdr.length =
-					htons(sizeof(sctp_paramhdr_t) + 2);
+			auth_chunks->param_hdr.length += htons(2);
 		}
 	}
 
net/sctp/socket.c +65 -20

189 lines not on this page · raw message

Signature · 1 line
1.5.2.5
maintainer Applied
#2 lore raw

From: Vlad Yasevich <[email protected]>
Date: Wed, 20 Aug 2008 22:57:38 -0400

Quoted 5 lines

sctp: fix potential panics in the SCTP-AUTH API.

All of the SCTP-AUTH socket options could cause a panic if the extension is disabled and the API is envoked.

Quoted 8 lines

Additionally, there were some additional assumptions that certain pointers would always be valid which may not always be the case.

This patch hardens the API and address all of the crash scenarios.

Applied, thanks for working on this so quickly Vlad.

I'll queue this up for -stable.