From nobody Fri Sep 05 06:49:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cJ6R404fkz67Bls; Fri, 05 Sep 2025 06:49:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cJ6R36SK6z3wbv; Fri, 05 Sep 2025 06:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757054991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NfNnWHOfDb+hR37iUSENVf7Cx/7THujYD+3xUk2MaTE=; b=I+THb9oOE2QLKgwt8206af/LtLb/JpU13V9g6JmH2iEVJ3wv/V6OeJ//KQdvgb6JQoZw+7 wJ/1ikBhbZ2Cc5sBhF4pvZivIR5FkV8vUJ2bSIW+qGkjgeR/gphJDE2t0kKYS/Sni/DdgT Xn6+hWj2zwC3+4Qk5Y2f+9Ml/kKKL0+c1kXnB5tcbyMNMqpcfjBuB8Cp4kbgDnonR0jsgb wa6ifwvApr6gdCmfsra/M97NDL3KTWg6HxEqbqzJw3Z3rlqmChSTViqF8Cs0fYgIbJ3XJS i1DlDd9DFlMlG15AORDgWV6PLsifKjXBrRnZDyYZHwItjleBWfmvwowkYTCwYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757054991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NfNnWHOfDb+hR37iUSENVf7Cx/7THujYD+3xUk2MaTE=; b=YXErmt8bUCG7fBm4nxsveZsCmZ9h/lWcxLiWFulkPIOhfqLzK+7tfpg7j3Hc2NvnjfbrW9 6gOd6ECs8X3c1iwGKnHt1yHIwwSRtKCgcxNfEGZ4KTvmKbUvitkKI5upnpRyTmibu9KnhD SYzgDb+QM5Hln5Uqe9eCm+vqq9kvvdVLxl8q33kFDinpVgCk+goPKwmnDcfx1nbV+kCEey edD/GFrz51o33Sstqg17HeOfBma1UD6hlsH3IDtxVUO8w7zlIuhV+1QwKv45aH+93TjO6y 6Y9qRW1C67UFx/RcaHNplpJF7N6fwLg/paSMCfqlLVpGMKFCxP91XQWcS39rcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757054991; a=rsa-sha256; cv=none; b=aw4UhGe51zV/AON0gt42AeJ8IzvYhIUimQ3RhnDRaYoLMw/k+dOd8VTXHctKbmzq+wqWRQ DTNUsyYtMe/UoVuSdKiPhE4fTwo1BQrEnxwHsFITUWsfGt6tTUA3trD1uN8qf0m+sQcHmV pLEjZdAilPpcjAAtYfYSbk3t1LP5zh2Vz2nUdqZIkQPrbnO4FhzYVZLGdwZQYrRIqAc2hm tXRy3M3aFStwzfRPvD7oHwrsAeJxXhm5ynsD0ME4rog1JCPMtoxTpBI6IHkPEGzIfPA6Vc bMZf7kI6o1t35O9zY2+FylOH30sZxFWdYek23HxuKqMB4w6WU+M+26XfPQcnVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cJ6R35klQzdvW; Fri, 05 Sep 2025 06:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5856npRj046709; Fri, 5 Sep 2025 06:49:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5856npxE046706; Fri, 5 Sep 2025 06:49:51 GMT (envelope-from git) Date: Fri, 5 Sep 2025 06:49:51 GMT Message-Id: <202509050649.5856npxE046706@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 2a38a33b221e - stable/14 - tcp: fix the test that a duplicate ACK has no data List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2a38a33b221ea96389e95eb7fa5d8ac4c6664a9e Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=2a38a33b221ea96389e95eb7fa5d8ac4c6664a9e commit 2a38a33b221ea96389e95eb7fa5d8ac4c6664a9e Author: Michael Tuexen AuthorDate: 2025-07-19 13:03:22 +0000 Commit: Michael Tuexen CommitDate: 2025-09-05 06:49:07 +0000 tcp: fix the test that a duplicate ACK has no data When processing a TCP segment, data is removed from the head or the tail. The test whether a segment has no data on it should depend on the TCP segment before the removal. Without this, received segments might trigger a fast retransmit even when they should not. Reported by: syzbot+fc97a2b5a0f7ea161161@syzkaller.appspotmail.com Reviewed by: Peter Lei Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51425 (cherry picked from commit e46c15a0f848174f58bb08fed8e173a76b4c473a) --- sys/netinet/tcp_input.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index fb0c110d460d..f4d061557e88 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1541,7 +1541,9 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, struct tcpopt to; int tfo_syn; u_int maxseg; + bool no_data; + no_data = (tlen == 0); thflags = tcp_get_flags(th); tp->sackhint.last_sack_ack = 0; sack_changed = SACK_NOCHANGE; @@ -1769,7 +1771,7 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, tp->ts_recent = to.to_tsval; } - if (tlen == 0) { + if (no_data) { if (SEQ_GT(th->th_ack, tp->snd_una) && SEQ_LEQ(th->th_ack, tp->snd_max) && !IN_RECOVERY(tp->t_flags) && @@ -2570,7 +2572,7 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, if (SEQ_LEQ(th->th_ack, tp->snd_una)) { maxseg = tcp_maxseg(tp); - if (tlen == 0 && + if (no_data && (tiwin == tp->snd_wnd || (tp->t_flags & TF_SACK_PERMIT))) { /* @@ -3104,8 +3106,7 @@ step6: (tp->snd_wl1 == th->th_seq && (SEQ_LT(tp->snd_wl2, th->th_ack) || (tp->snd_wl2 == th->th_ack && tiwin > tp->snd_wnd))))) { /* keep track of pure window updates */ - if (tlen == 0 && - tp->snd_wl2 == th->th_ack && tiwin > tp->snd_wnd) + if (no_data && tp->snd_wl2 == th->th_ack && tiwin > tp->snd_wnd) TCPSTAT_INC(tcps_rcvwinupd); tp->snd_wnd = tiwin; tp->snd_wl1 = th->th_seq;