Skip to content

Commit 6afd2e8

Browse files
Vlad Yasevichdavem330
authored andcommitted
[SCTP]: Discard unauthenticated ASCONF and ASCONF ACK chunks
Now that we support AUTH, discard unauthenticated ASCONF and ASCONF ACK chunks as mandated in the ADD-IP spec. Signed-off-by: Vlad Yasevich <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 195ad6a commit 6afd2e8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

net/sctp/sm_statefuns.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3377,6 +3377,15 @@ sctp_disposition_t sctp_sf_do_asconf(const struct sctp_endpoint *ep,
33773377
return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
33783378
}
33793379

3380+
/* ADD-IP: Section 4.1.1
3381+
* This chunk MUST be sent in an authenticated way by using
3382+
* the mechanism defined in [I-D.ietf-tsvwg-sctp-auth]. If this chunk
3383+
* is received unauthenticated it MUST be silently discarded as
3384+
* described in [I-D.ietf-tsvwg-sctp-auth].
3385+
*/
3386+
if (!sctp_addip_noauth && !chunk->auth)
3387+
return sctp_sf_discard_chunk(ep, asoc, type, arg, commands);
3388+
33803389
/* Make sure that the ASCONF ADDIP chunk has a valid length. */
33813390
if (!sctp_chunk_length_valid(chunk, sizeof(sctp_addip_chunk_t)))
33823391
return sctp_sf_violation_chunklen(ep, asoc, type, arg,
@@ -3463,6 +3472,15 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep,
34633472
return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
34643473
}
34653474

3475+
/* ADD-IP, Section 4.1.2:
3476+
* This chunk MUST be sent in an authenticated way by using
3477+
* the mechanism defined in [I-D.ietf-tsvwg-sctp-auth]. If this chunk
3478+
* is received unauthenticated it MUST be silently discarded as
3479+
* described in [I-D.ietf-tsvwg-sctp-auth].
3480+
*/
3481+
if (!sctp_addip_noauth && !asconf_ack->auth)
3482+
return sctp_sf_discard_chunk(ep, asoc, type, arg, commands);
3483+
34663484
/* Make sure that the ADDIP chunk has a valid length. */
34673485
if (!sctp_chunk_length_valid(asconf_ack, sizeof(sctp_addip_chunk_t)))
34683486
return sctp_sf_violation_chunklen(ep, asoc, type, arg,

0 commit comments

Comments
 (0)