From d8567f5ddfc09080391238254c8e50e42d7e27f4 Mon Sep 17 00:00:00 2001 From: delphij Date: Tue, 21 Jul 2015 23:42:56 +0000 Subject: [PATCH] Fix resource exhaustion due to sessions stuck in LAST_ACK state. Security: CVE-2015-5358 Security: SA-15:13.tcp Submitted by: Jonathan Looney (Juniper SIRT) Approved by: so git-svn-id: svn://svn.freebsd.org/base/releng/9.3@285780 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- UPDATING | 5 +++++ sys/conf/newvers.sh | 2 +- sys/netinet/tcp_output.c | 11 +++++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/UPDATING b/UPDATING index 4fe2f45de..124467c39 100644 --- a/UPDATING +++ b/UPDATING @@ -11,6 +11,11 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20150721: p20 FreeBSD-SA-15:13.tcp + + Fix resource exhaustion due to sessions stuck in LAST_ACK state. + [SA-15:13] + 20150707: p19 FreeBSD-SA-15:11.bind Fix BIND resolver remote denial of service when validating. diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 38b99c433..3b7d9afe5 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.3" -BRANCH="RELEASE-p19" +BRANCH="RELEASE-p20" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 79b1d6f85..d2fd28d85 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -397,7 +397,7 @@ after_sack_rexmit: flags &= ~TH_FIN; } - if (len < 0) { + if (len <= 0) { /* * If FIN has been sent but not acked, * but we haven't been called to retransmit, @@ -407,9 +407,16 @@ after_sack_rexmit: * to (closed) window, and set the persist timer * if it isn't already going. If the window didn't * close completely, just wait for an ACK. + * + * We also do a general check here to ensure that + * we will set the persist timer when we have data + * to send, but a 0-byte window. This makes sure + * the persist timer is set even if the packet + * hits one of the "goto send" lines below. */ len = 0; - if (sendwin == 0) { + if ((sendwin == 0) && (TCPS_HAVEESTABLISHED(tp->t_state)) && + (off < (int) so->so_snd.sb_cc)) { tcp_timer_activate(tp, TT_REXMT, 0); tp->t_rxtshift = 0; tp->snd_nxt = tp->snd_una; -- 2.42.0