Skip to contentSkip to conversation

fix sctp breakage

PATCH Applied Al Viro 3 participants 4 messages Mar 18, 2009 – Mar 19, 2009

Subsystems (3)
lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/1 fix sctp breakage

broken by commit 5e739d1752aca4e8f3e794d431503bfca3162df4; AFAICS should be -stable fodder as well...

---

net/sctp/endpointola.c +2 -1
index 4c8d9f4..905fda5 100644
@@ -111,7 +111,8 @@ 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(2);
+			auth_chunks->param_hdr.length =
+					htons(sizeof(sctp_paramhdr_t) + 2);
 		}
 	}
 
author
#1 lore raw
Quoted 2 lines · Al Viro

broken by commit 5e739d1752aca4e8f3e794d431503bfca3162df4; AFAICS should be -stable fodder as well...

PS: existing code *DOES* produce correct value; sizeof in question is 4, and htons(4) + htons(2) happens to be equal to htons(6) (no carryover). So before anyone starts moaning about coverups again, no, this is not a roothole fix we are trying to get past grsec tossers.

It needs fixing, though, accidentally correct value or not.

#2 lore raw
In reply to Al Viro
Quoted 10 lines · Al Viro

broken by commit 5e739d1752aca4e8f3e794d431503bfca3162df4; AFAICS should be -stable fodder as well...

---

net/sctp/endpointola.c +0 -0
index 4c8d9f4..905fda5 100644

net/sctp/endpointola.c static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep, · line 118

Quoted 9 lines
net/sctp/endpointola.c +2 -1
@@ -111,7 +111,8 @@ 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(2);
+			auth_chunks->param_hdr.length =
+					htons(sizeof(sctp_paramhdr_t) + 2);
 		}
 	}
 

ACK. That wasn't a good way to write that increment. I should have thought more about it, but at the time it seemed like a good idea...

Thanks
-vlad

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer Applied
#3 lore raw

From: Vlad Yasevich <[email protected]>
Date: Wed, 18 Mar 2009 08:28:44 -0400

Quoted 5 lines
Quoted 4 lines · Al Viro

broken by commit 5e739d1752aca4e8f3e794d431503bfca3162df4; AFAICS should be -stable fodder as well...

...

Quoted 2 lines

ACK. That wasn't a good way to write that increment. I should have thought more about it, but at the time it seemed like a good idea...

Applied, thanks.