From nobody Thu Jan 27 18:19:10 2022 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 378661969EE5; Thu, 27 Jan 2022 18:19:11 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jl84H0j18z3jC3; Thu, 27 Jan 2022 18:19:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643307551; 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=RTz/Lj4BHFfmjzzS/61awEHqWhPlui2dQobAryCIdII=; b=gleQzBHwjUc8dS0SfwVNU7f3ESx5R/arABOBAis+tzNFR5mH1Z5V3SZwJLCQ+nLQthtiud UR+u4hjnmG7KcdoYBLppmdeXqYwPFAQawJgFjX/NG9oi7sFl4Iar9IHyXROl0ZvVxisUFu YOAx7wwnR42NWI/ge24bqlE7BEx5K+zBOE8RhxBC3ObXCzQ4y96PqjCTZ7gmqrcKXq6pH/ Nmo+c3FNRmz807kJrM0mzHT62Wzm9oCs+J8HmT0l1lR+T5H7B5rD9uooa3FHnQlcTMyxq5 pSNN58zo1/vu9vQCnxEGYerCvpFjz8knxlHG/lc7wUAofuTzcDPoM65XJg+znw== 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 ECC001B46A; Thu, 27 Jan 2022 18:19:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20RIJAqp049158; Thu, 27 Jan 2022 18:19:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20RIJATR049157; Thu, 27 Jan 2022 18:19:10 GMT (envelope-from git) Date: Thu, 27 Jan 2022 18:19:10 GMT Message-Id: <202201271819.20RIJATR049157@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 68e623c3f0af - main - tcp: Rewind erraneous RTO only while performing RTO retransmissions 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 68e623c3f0afb4c9b338046fd1d4476befd82324 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643307551; 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=RTz/Lj4BHFfmjzzS/61awEHqWhPlui2dQobAryCIdII=; b=nwMhSMwzs4XfMwwaJs/1j5cCf92OU/oHHRnTowOKFU7bfzPrXSWaOWMI2x++NfY4ajsCRi hGRhTNJEgEy5ZvtopX6bLh4uhBiiUimILSH7d/NH6GDjSK2ZQUffXiiJKH3MPCkUqGj8KI jhibdI9fZ4vkK/rvsH28M0tIzkLjbgssTNppKpPeO2mZswvTK0r9DueAwf4M0InN79o9KT CAn3GuDSPwyuWCfgFZpwuHRkF7kCg8qm9CH6L5EKaeTXvJkz3K9V0TeegeVz+zgZhlnqM2 87dftK1pW1halyc0ve2ouFJWjG1jKWqNwshzdZHzPkmqLmkdxQqOcYeFoRLWvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643307551; a=rsa-sha256; cv=none; b=ftARXi4hhDXY3Dg28yQ3T+EVCdvbwmp8b5xc2mtCrZXCL9/GSMuoXOqpkCh8L95xJku+61 G6H6plK88xRo0EYz9MLta9+e8wX0FruJh72DXEiAghU7t8wL/lL6OCGkQo66SZfXft1QX1 szcxRUUI+QSpL5ZdQ7kbC8aRd8gKaxRekUodvHfKk+v3CGjW5fGCBOmTt4aI8o5Adwhx1i l3D8Chp69ilt1d3Bsevoytu2ozS+Mmryt6jupFdFYQgqShbK7LfMpsYpb+K/o+Y0u42eHJ nd69xJ1WNFMHMr91LEoaR0jm284Q1U8dFcVckWH97U9HddgG9y2JhWC8ceSDRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=68e623c3f0afb4c9b338046fd1d4476befd82324 commit 68e623c3f0afb4c9b338046fd1d4476befd82324 Author: Richard Scheffenegger AuthorDate: 2022-01-27 17:35:47 +0000 Commit: Richard Scheffenegger CommitDate: 2022-01-27 17:49:42 +0000 tcp: Rewind erraneous RTO only while performing RTO retransmissions 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 --- sys/netinet/tcp_input.c | 1 + sys/netinet/tcp_var.h | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 110cb99df7bb..d6d193d18213 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1649,6 +1649,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); } diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index e9d021fb4684..07788ada3985 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -506,7 +506,11 @@ tcp_unlock_or_drop(struct tcpcb *tp, int tcp_output_retval) #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 */