diff options
author | delphij <delphij@FreeBSD.org> | 2015-07-21 23:42:17 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2015-07-21 23:42:17 +0000 |
commit | 457165363e08c575f189297c574b0dcd6753945d (patch) | |
tree | 639082742108a922c84e3b66f24cc5296597176c /sys/netinet | |
parent | c704c25de7018b5f7a16bfc4d7fd7092ed45bd57 (diff) | |
download | FreeBSD-src-457165363e08c575f189297c574b0dcd6753945d.zip FreeBSD-src-457165363e08c575f189297c574b0dcd6753945d.tar.gz |
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: re (so blanket)
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/tcp_output.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index b6f4b30..f7265dc 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -400,7 +400,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, @@ -410,9 +410,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; |