revert rS360143 - Correctly set up initial cwnd

due to syzkaller panics found

Reported by:	tuexen
Approved by:	tuexen (mentor)
Sponsored by:	NetApp, Inc.
This commit is contained in:
Richard Scheffenegger 2020-04-22 00:16:42 +00:00
parent 81b62a7663
commit bb410f9ff2
3 changed files with 17 additions and 18 deletions

View File

@ -2374,6 +2374,12 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
if (IS_FASTOPEN(tp->t_flags) && tp->t_tfo_pending) { if (IS_FASTOPEN(tp->t_flags) && tp->t_tfo_pending) {
tcp_fastopen_decrement_counter(tp->t_tfo_pending); tcp_fastopen_decrement_counter(tp->t_tfo_pending);
tp->t_tfo_pending = NULL; 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) { if (tp->t_flags & TF_NEEDFIN) {
tcp_state_change(tp, TCPS_FIN_WAIT_1); tcp_state_change(tp, TCPS_FIN_WAIT_1);
@ -2393,12 +2399,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
cc_conn_init(tp); cc_conn_init(tp);
tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(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() * If segment contains data or ACK, will call tcp_reass()
* later; if not, do so now to pass queued data to user. * later; if not, do so now to pass queued data to user.

View File

@ -9325,6 +9325,11 @@ bbr_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so,
tcp_fastopen_decrement_counter(tp->t_tfo_pending); tcp_fastopen_decrement_counter(tp->t_tfo_pending);
tp->t_tfo_pending = NULL; 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* -> * Make transitions: SYN-RECEIVED -> ESTABLISHED SYN-RECEIVED* ->
@ -9347,12 +9352,6 @@ bbr_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so,
if (!IS_FASTOPEN(tp->t_flags)) if (!IS_FASTOPEN(tp->t_flags))
cc_conn_init(tp); 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 * If segment contains data or ACK, will call tcp_reass() later; if
* not, do so now to pass queued data to user. * not, do so now to pass queued data to user.

View File

@ -6539,6 +6539,12 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so,
if (IS_FASTOPEN(tp->t_flags) && tp->t_tfo_pending) { if (IS_FASTOPEN(tp->t_flags) && tp->t_tfo_pending) {
tcp_fastopen_decrement_counter(tp->t_tfo_pending); tcp_fastopen_decrement_counter(tp->t_tfo_pending);
tp->t_tfo_pending = NULL; 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) { if (tp->t_flags & TF_NEEDFIN) {
tcp_state_change(tp, TCPS_FIN_WAIT_1); tcp_state_change(tp, TCPS_FIN_WAIT_1);
@ -6556,12 +6562,6 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, struct socket *so,
if (!IS_FASTOPEN(tp->t_flags)) if (!IS_FASTOPEN(tp->t_flags))
cc_conn_init(tp); 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 * If segment contains data or ACK, will call tcp_reass() later; if
* not, do so now to pass queued data to user. * not, do so now to pass queued data to user.