Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Dec 2018 22:14:18 +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-12@freebsd.org
Subject:   svn commit: r341501 - stable/12/sys/netinet/tcp_stacks
Message-ID:  <201812042214.wB4MEIIl098548@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Tue Dec  4 22:14:18 2018
New Revision: 341501
URL: https://svnweb.freebsd.org/changeset/base/341501

Log:
  MFC r340782:
  
  A TCP stack is required to check SEG.ACK first, when processing a
  segment in the SYN-SENT state as stated in Section 3.9 of RFC 793,
  page 66. Ensure this is also done by the TCP RACK stack.
  
  Reviewed by:		rrs@
  Sponsored by:		Netflix, Inc.
  Differential Revision:	https://reviews.freebsd.org/D18034

Modified:
  stable/12/sys/netinet/tcp_stacks/rack.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/tcp_stacks/rack.c
==============================================================================
--- stable/12/sys/netinet/tcp_stacks/rack.c	Tue Dec  4 22:13:05 2018	(r341500)
+++ stable/12/sys/netinet/tcp_stacks/rack.c	Tue Dec  4 22:14:18 2018	(r341501)
@@ -6533,6 +6533,15 @@ rack_hpts_do_segment(struct mbuf *m, struct tcphdr *th
 		goto done_with_input;
 	}
 	/*
+	 * If a segment with the ACK-bit set arrives in the SYN-SENT state
+	 * check SEQ.ACK first as described on page 66 of RFC 793, section 3.9.
+	 */
+	if ((tp->t_state == TCPS_SYN_SENT) && (thflags & TH_ACK) &&
+	    (SEQ_LEQ(th->th_ack, tp->iss) || SEQ_GT(th->th_ack, tp->snd_max))) {
+		rack_do_dropwithreset(m, tp, th, BANDLIM_RST_OPENPORT, tlen);
+		return;
+	}
+	/*
 	 * Segment received on connection. Reset idle time and keep-alive
 	 * timer. XXX: This should be done after segment validation to
 	 * ignore broken/spoofed segs.



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