From nobody Sat Jul 19 14:31:34 2025 X-Original-To: dev-commits-src-main@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 4bkpxz3KhMz61tRQ; Sat, 19 Jul 2025 14:31:35 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bkpxy5HCLz3kZ6; Sat, 19 Jul 2025 14:31:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752935494; 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=phl/CLpDbkRCb65uoI2KX7JIE0nqsoAWiuHaagnuaDQ=; b=NWXYblkeQ5EwPXBTNr9d+AxvdBOrZyitOAfZbZcKYROGMlYxutzTSfzcublP7ga/gdjdlH hVI6Z3iiCwpnNsrfCGoarRTTQVPmp6Ww71Q0DKYPPL/iu/57RL70iwbbL/NbjKhWO92Q2J 37sccgbA9Ss6rORSJHgWM9VHFq2lFOzE5iLCw4mzAHB3JeGylCp2zo9ZDHsOq5MhOSDLWV HsBUfsV/CbQgaE2xh/4YFTOP2BtugY1KkbIyljP8iHQoJJ1E5xNPxfsdwuuRCwFwa1B6kW 9dGUOsMkn0CxNojcSr6k7N+aBBjDG2xxZNP9hkEO6k0RrY0KFawpD86hmuJlHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752935494; 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=phl/CLpDbkRCb65uoI2KX7JIE0nqsoAWiuHaagnuaDQ=; b=yZeHhbmO0fBXdKoPJnnrrDXB0yfvbZ8thrbKVHji7nEqwaAvLJegR2dW9y11QnY6r+zruY UTyxtO4aLeFVWNVxWXsDHGFEr0Z6VYIu20aEKonNhAcU8qmCsLH14sAyWAM5YU5KOT6Re6 ILD+dsvlxq9kDyT0m+MFOy/YqZtDdSWiIiD5k+TjcSNerXpzwA3yoF4X0Lmckd5uiaCbLY A2nt7fvebob9ozbOP4dQuICZNKpjqxh3kbvvC42O3x+fJYML0MbT8v8gtfWnQlXUz/9pKj 2Q09tr5uX53de0Ydd7Zq3OU5c5FXH3G4lZXq+SwqWr1udsad65lj5/WtoICgSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752935494; a=rsa-sha256; cv=none; b=MTg5Tsd986C7TzgCYPOLpNV2x4fWGmDKjlaYQZitX38/Nb74d1VI6o+7IyCaXz4dsu/4qb r84/YIEyJvLbpEp/0aUKiWjCRVN4gKHVZ2ELX4Azi/aUnnp0Sgvmeqd4EC0aEQ9TFsjSGf 2e8xahMXrxzFdBQ0xt8MzQwDxFgPU3ctB0k32y+1TxICItsccLth4voaLhKmJfoEwt+B2X SCsQbWlLjx7RhKOiCOsqTfWlnVzmgfqUsEETs69emaehfFojg35HNALzBQbMBoTEzpu+Vs d5KMY0QMvYvdHsI1+y0HwbkHG2zGwY9bqUtW1+EJdFAZOoJJ7lOeM+LEM2TXsw== 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 4bkpxy4v4ZzVhX; Sat, 19 Jul 2025 14:31:34 +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 56JEVY9P074574; Sat, 19 Jul 2025 14:31:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56JEVYAP074571; Sat, 19 Jul 2025 14:31:34 GMT (envelope-from git) Date: Sat, 19 Jul 2025 14:31:34 GMT Message-Id: <202507191431.56JEVYAP074571@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: e46c15a0f848 - main - tcp: fix the test that a duplicate ACK has no data List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: e46c15a0f848174f58bb08fed8e173a76b4c473a Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e46c15a0f848174f58bb08fed8e173a76b4c473a commit e46c15a0f848174f58bb08fed8e173a76b4c473a Author: Michael Tuexen AuthorDate: 2025-07-19 13:03:22 +0000 Commit: Michael Tuexen CommitDate: 2025-07-19 13:03:22 +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 MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51425 --- 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 7c032e13f37a..f0921032ef31 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1515,7 +1515,9 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, struct tcpopt to; int tfo_syn; u_int maxseg = 0; + bool no_data; + no_data = (tlen == 0); thflags = tcp_get_flags(th); tp->sackhint.last_sack_ack = 0; sack_changed = SACK_NOCHANGE; @@ -1754,7 +1756,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) && @@ -2557,7 +2559,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))) { /* @@ -3113,8 +3115,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;