Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Jun 2018 20:03:35 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r334732 - stable/11/sys/netinet
Message-ID:  <201806062003.w56K3ZGc011616@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Wed Jun  6 20:03:35 2018
New Revision: 334732
URL: https://svnweb.freebsd.org/changeset/base/334732

Log:
  MFC r334532:
  
  Don't overflow a buffer if we receive an INIT or INIT-ACK chunk
  without a RANDOM parameter but with a CHUNKS or HMAC-ALGO parameter.
  Please note that sending this combination violates the specification.
  
  Thanks to Ronald E. Crane for reporting the issue for the userland
  stack.

Modified:
  stable/11/sys/netinet/sctp_auth.c
  stable/11/sys/netinet/sctp_pcb.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/sctp_auth.c
==============================================================================
--- stable/11/sys/netinet/sctp_auth.c	Wed Jun  6 20:02:05 2018	(r334731)
+++ stable/11/sys/netinet/sctp_auth.c	Wed Jun  6 20:03:35 2018	(r334732)
@@ -1502,6 +1502,8 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, str
 		if (p_random != NULL) {
 			keylen = sizeof(*p_random) + random_len;
 			memcpy(new_key->key, p_random, keylen);
+		} else {
+			keylen = 0;
 		}
 		/* append in the AUTH chunks */
 		if (chunks != NULL) {

Modified: stable/11/sys/netinet/sctp_pcb.c
==============================================================================
--- stable/11/sys/netinet/sctp_pcb.c	Wed Jun  6 20:02:05 2018	(r334731)
+++ stable/11/sys/netinet/sctp_pcb.c	Wed Jun  6 20:03:35 2018	(r334732)
@@ -6702,6 +6702,8 @@ next_param:
 		if (p_random != NULL) {
 			keylen = sizeof(*p_random) + random_len;
 			memcpy(new_key->key, p_random, keylen);
+		} else {
+			keylen = 0;
 		}
 		/* append in the AUTH chunks */
 		if (chunks != NULL) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806062003.w56K3ZGc011616>