Skip to content

Commit

Permalink
tcp: Rewind erraneous RTO only while performing RTO retransmissions
Browse files Browse the repository at this point in the history
Under rare circumstances, a spurious retranmission is
incorrectly detected and rewound, messing up various tcpcb values,
which can lead to a panic when SACK is in use.

Reviewed By: tuexen, chengc_netapp.com, #transport
MFC after:   3 days
Sponsored by:        NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D33979

(cherry picked from commit 68e623c)
  • Loading branch information
rscheff committed Jan 30, 2022
1 parent 037fe75 commit 15d6a1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions sys/netinet/tcp_input.c
Expand Up @@ -1654,6 +1654,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
if (TSTMP_GT(to.to_tsecr, tcp_ts_getticks()))
to.to_tsecr = 0;
else if (tp->t_flags & TF_PREVVALID &&
tp->t_rxtshift == 1 &&
tp->t_badrxtwin != 0 && SEQ_LT(to.to_tsecr, tp->t_badrxtwin))
cc_cong_signal(tp, th, CC_RTO_ERR);
}
Expand Down
6 changes: 5 additions & 1 deletion sys/netinet/tcp_var.h
Expand Up @@ -398,7 +398,11 @@ TAILQ_HEAD(tcp_funchead, tcp_function);
#define TF_NEEDSYN 0x00000400 /* send SYN (implicit state) */
#define TF_NEEDFIN 0x00000800 /* send FIN (implicit state) */
#define TF_NOPUSH 0x00001000 /* don't push */
#define TF_PREVVALID 0x00002000 /* saved values for bad rxmit valid */
#define TF_PREVVALID 0x00002000 /* saved values for bad rxmit valid
* Note: accessing and restoring from
* these may only be done in the 1st
* RTO recovery round (t_rxtshift == 1)
*/
#define TF_WAKESOR 0x00004000 /* wake up receive socket */
#define TF_GPUTINPROG 0x00008000 /* Goodput measurement in progress */
#define TF_MORETOCOME 0x00010000 /* More data to be appended to sock */
Expand Down

0 comments on commit 15d6a1f

Please sign in to comment.