Author: rscheff
Date: Wed Apr 22 00:16:42 2020
New Revision: 360180
URL: https://svnweb.freebsd.org/changeset/base/360180

Log:
  revert rS360143 - Correctly set up  initial cwnd
  due to syzkaller panics found
  
  Reported by:  tuexen
  Approved by:  tuexen (mentor)
  Sponsored by: NetApp, Inc.

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_stacks/bbr.c
  head/sys/netinet/tcp_stacks/rack.c

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c        Tue Apr 21 23:38:54 2020        
(r360179)
+++ head/sys/netinet/tcp_input.c        Wed Apr 22 00:16:42 2020        
(r360180)
@@ -2374,6 +2374,12 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
                if (IS_FASTOPEN(tp->t_flags) && tp->t_tfo_pending) {
                        tcp_fastopen_decrement_counter(tp->t_tfo_pending);
                        tp->t_tfo_pending = NULL;
+
+                       /*
+                        * Account for the ACK of our SYN prior to
+                        * regular ACK processing below.
+                        */
+                       tp->snd_una++;
                }
                if (tp->t_flags & TF_NEEDFIN) {
                        tcp_state_change(tp, TCPS_FIN_WAIT_1);
@@ -2393,12 +2399,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru
                                cc_conn_init(tp);
                        tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp));
                }
-               if (SEQ_GT(th->th_ack, tp->snd_una))
-                       /*
-                        * Account for the ACK of our SYN prior to
-                        * regular ACK processing below.
-                        */
-                       tp->snd_una++;
                /*
                 * If segment contains data or ACK, will call tcp_reass()
                 * later; if not, do so now to pass queued data to user.

Modified: head/sys/netinet/tcp_stacks/bbr.c
==============================================================================
--- head/sys/netinet/tcp_stacks/bbr.c   Tue Apr 21 23:38:54 2020        
(r360179)
+++ head/sys/netinet/tcp_stacks/bbr.c   Wed Apr 22 00:16:42 2020        
(r360180)
@@ -9325,6 +9325,11 @@ bbr_do_syn_recv(struct mbuf *m, struct tcphdr *th, str
 
                tcp_fastopen_decrement_counter(tp->t_tfo_pending);
                tp->t_tfo_pending = NULL;
+               /*
+                * Account for the ACK of our SYN prior to regular
+                * ACK processing below.
+                */
+               tp->snd_una++;
        }
        /*
         * Make transitions: SYN-RECEIVED  -> ESTABLISHED SYN-RECEIVED* ->
@@ -9347,12 +9352,6 @@ bbr_do_syn_recv(struct mbuf *m, struct tcphdr *th, str
                if (!IS_FASTOPEN(tp->t_flags))
                        cc_conn_init(tp);
        }
-       if (SEQ_GT(th->th_ack, tp->snd_una))
-               /*
-                * Account for the ACK of our SYN prior to
-                * regular ACK processing below.
-                */
-               tp->snd_una++;
        /*
         * If segment contains data or ACK, will call tcp_reass() later; if
         * not, do so now to pass queued data to user.

Modified: head/sys/netinet/tcp_stacks/rack.c
==============================================================================
--- head/sys/netinet/tcp_stacks/rack.c  Tue Apr 21 23:38:54 2020        
(r360179)
+++ head/sys/netinet/tcp_stacks/rack.c  Wed Apr 22 00:16:42 2020        
(r360180)
@@ -6539,6 +6539,12 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st
        if (IS_FASTOPEN(tp->t_flags) && tp->t_tfo_pending) {
                tcp_fastopen_decrement_counter(tp->t_tfo_pending);
                tp->t_tfo_pending = NULL;
+
+               /*
+                * Account for the ACK of our SYN prior to
+                * regular ACK processing below.
+                */
+               tp->snd_una++;
        }
        if (tp->t_flags & TF_NEEDFIN) {
                tcp_state_change(tp, TCPS_FIN_WAIT_1);
@@ -6556,12 +6562,6 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st
                if (!IS_FASTOPEN(tp->t_flags))
                        cc_conn_init(tp);
        }
-       if (SEQ_GT(th->th_ack, tp->snd_una))
-               /*
-                * Account for the ACK of our SYN prior to
-                * regular ACK processing below.
-                */
-               tp->snd_una++;
        /*
         * If segment contains data or ACK, will call tcp_reass() later; if
         * not, do so now to pass queued data to user.
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to