git: ce78b5a3d475 - stable/15 - tcp: improve ISS checking for ghost ACKs
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 26 Nov 2026 08:17:56 UTC
The branch stable/15 has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=ce78b5a3d47574fafbe86d1ce9dcef7c19360e95
commit ce78b5a3d47574fafbe86d1ce9dcef7c19360e95
Author: Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2026-11-24 13:45:27 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2026-11-26 08:15:48 +0000
tcp: improve ISS checking for ghost ACKs
The check in tcp_adapt_iss_check() depends on SND.UNA and therefore
should be performed whenever SND.UNA is incremented.
PR: 298560
Reviewed by: Peter Lei
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D61749
(cherry picked from commit 9e345ca583f702e7472f836136e766d3346c049d)
---
sys/netinet/tcp_input.c | 3 ++-
sys/netinet/tcp_stacks/bbr.c | 3 ++-
sys/netinet/tcp_stacks/rack.c | 5 ++++-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 9ce14e3019ca..05659fc7455a 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1857,6 +1857,7 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th,
cc_ack_received(tp, th, nsegs, CC_ACK);
tp->snd_una = th->th_ack;
+ tcp_adapt_iss_check(tp);
/*
* Pull snd_wl2 up to prevent seq wrap relative
* to th_ack.
@@ -2439,7 +2440,6 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th,
/*
* Ack processing.
*/
- tcp_adapt_iss_check(tp);
if (!V_tcp_insecure_ack) {
tcp_seq seq_min;
bool ghost_ack_check;
@@ -3035,6 +3035,7 @@ process_ACK:
SEQ_LEQ(th->th_ack, tp->snd_recover))
tp->snd_recover = th->th_ack - 1;
tp->snd_una = th->th_ack;
+ tcp_adapt_iss_check(tp);
if (IN_RECOVERY(tp->t_flags) &&
SEQ_GEQ(th->th_ack, tp->snd_recover)) {
cc_post_recovery(tp, th);
diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c
index 6e4535a87bb6..18d687a293ac 100644
--- a/sys/netinet/tcp_stacks/bbr.c
+++ b/sys/netinet/tcp_stacks/bbr.c
@@ -7686,7 +7686,6 @@ bbr_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so,
bbr = (struct tcp_bbr *)tp->t_fb_ptr;
lost = bbr->r_ctl.rc_lost;
nsegs = max(1, m->m_pkthdr.lro_nsegs);
- tcp_adapt_iss_check(tp);
if (!V_tcp_insecure_ack) {
tcp_seq seq_min;
bool ghost_ack_check;
@@ -7806,6 +7805,7 @@ bbr_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so,
bbr_collapse_rtt(tp, bbr, TCP_REXMTVAL(tp));
}
tp->snd_una = th->th_ack;
+ tcp_adapt_iss_check(tp);
bbr_ack_received(tp, bbr, th, acked, sack_changed, prev_acked, __LINE__, (bbr->r_ctl.rc_lost - lost));
if (IN_RECOVERY(tp->t_flags)) {
if (SEQ_LT(th->th_ack, tp->snd_recover) &&
@@ -8672,6 +8672,7 @@ bbr_fastack(struct mbuf *m, struct tcphdr *th, struct socket *so,
if (SEQ_GT(th->th_ack, tp->snd_una))
bbr_collapse_rtt(tp, bbr, TCP_REXMTVAL(tp));
tp->snd_una = th->th_ack;
+ tcp_adapt_iss_check(tp);
if (tp->snd_wnd < ctf_outstanding(tp))
/* The peer collapsed its window on us */
bbr_collapsed_window(bbr);
diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
index 503c172f78e5..d3b4656afd80 100644
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -11602,7 +11602,6 @@ rack_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so,
INP_WLOCK_ASSERT(tptoinpcb(tp));
rack = (struct tcp_rack *)tp->t_fb_ptr;
- tcp_adapt_iss_check(tp);
if (!V_tcp_insecure_ack) {
tcp_seq seq_min;
bool ghost_ack_check;
@@ -11820,6 +11819,7 @@ rack_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so,
ourfinisacked = 1;
}
tp->snd_una = th->th_ack;
+ tcp_adapt_iss_check(tp);
/* wakeups? */
if (acked_amount && sbavail(&so->so_snd))
rack_adjust_sendmap_head(rack, &so->so_snd);
@@ -12593,6 +12593,7 @@ rack_fastack(struct mbuf *m, struct tcphdr *th, struct socket *so,
SOCK_SENDBUF_LOCK(so);
mfree = sbcut_locked(&so->so_snd, acked);
tp->snd_una = th->th_ack;
+ tcp_adapt_iss_check(tp);
/* Note we want to hold the sb lock through the sendmap adjust */
rack_adjust_sendmap_head(rack, &so->so_snd);
/* Wake up the socket if we have room to write more */
@@ -15877,6 +15878,7 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb
* should be).
*/
tp->snd_una = high_seq;
+ tcp_adapt_iss_check(tp);
}
/* Did we make a RTO error? */
if ((tp->t_flags & TF_PREVVALID) &&
@@ -15911,6 +15913,7 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb
SOCK_SENDBUF_LOCK(so);
mfree = sbcut_locked(&so->so_snd, acked_amount);
tp->snd_una = high_seq;
+ tcp_adapt_iss_check(tp);
/* Note we want to hold the sb lock through the sendmap adjust */
rack_adjust_sendmap_head(rack, &so->so_snd);
/* Wake up the socket if we have room to write more */