Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Nov 2013 17:08:09 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r257803 - head/sys/netinet
Message-ID:  <201311071708.rA7H89wZ075503@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Thu Nov  7 17:08:09 2013
New Revision: 257803
URL: http://svnweb.freebsd.org/changeset/base/257803

Log:
  Make sure that we don't try to build an ASCONF-ACK chunk
  larger than what fits in the the mbuf cluster.
  This issue was reported by Andrew Galante.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_asconf.c

Modified: head/sys/netinet/sctp_asconf.c
==============================================================================
--- head/sys/netinet/sctp_asconf.c	Thu Nov  7 16:58:09 2013	(r257802)
+++ head/sys/netinet/sctp_asconf.c	Thu Nov  7 17:08:09 2013	(r257803)
@@ -2616,7 +2616,8 @@ sctp_compose_asconf(struct sctp_tcb *stc
 		/* get the parameter length */
 		p_length = SCTP_SIZE32(aa->ap.aph.ph.param_length);
 		/* will it fit in current chunk? */
-		if (SCTP_BUF_LEN(m_asconf) + p_length > stcb->asoc.smallest_mtu) {
+		if ((SCTP_BUF_LEN(m_asconf) + p_length > stcb->asoc.smallest_mtu) ||
+		    (SCTP_BUF_LEN(m_asconf) + p_length > MCLBYTES)) {
 			/* won't fit, so we're done with this chunk */
 			break;
 		}



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