aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2022-07-19 18:28:25 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2023-02-01 23:30:03 +0000
commit36d33812f387f1dbc3b9e7b15fd94004bb81fb4e (patch)
tree974cb931d3a9c32d09b6395e2f7183c88696c8d5
parenta00dbd88cc2da19a9624f0b24d3d9d4e5a13721a (diff)
downloadsrc-36d33812f387f1dbc3b9e7b15fd94004bb81fb4e.tar.gz
src-36d33812f387f1dbc3b9e7b15fd94004bb81fb4e.zip
tcp rack: fix switching to RACK when FIN has been sent
Fix the rack sendmap entry in case a FIN has been sent when the stack is switched over to RACK. Reported by: syzbot+dd55e316428419e9354b@syzkaller.appspotmail.com Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D35731 (cherry picked from commit 5b741298b11cdaec71877fa24b72764d1e697a33)
-rw-r--r--sys/netinet/tcp_stacks/rack.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
index 1cf89388399c..e11351e5c515 100644
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -12283,12 +12283,9 @@ rack_init(struct tcpcb *tp)
rsm->r_tim_lastsent[0] = rack_to_usec_ts(&rack->r_ctl.act_rcv_time);
rsm->r_rtr_cnt = 1;
rsm->r_rtr_bytes = 0;
- if (tp->t_flags & TF_SENTFIN) {
- rsm->r_end = tp->snd_max - 1;
+ if (tp->t_flags & TF_SENTFIN)
rsm->r_flags |= RACK_HAS_FIN;
- } else {
- rsm->r_end = tp->snd_max;
- }
+ rsm->r_end = tp->snd_max;
if (tp->snd_una == tp->iss) {
/* The data space is one beyond snd_una */
rsm->r_flags |= RACK_HAS_SYN;