From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D75D1E22E6; Mon, 23 Jun 2025 21:40:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750714848; cv=none; b=mvYMj3XzBu22SQfPzGlo6zCaAHhRytNig84ciC1EZwQcRlS8GqSbRy5jgkU1gRYmGOZ+ZFjpRJ6+3lJ40TRsnI1WUKW3PDdX23oIu+qdov1MdRmmXee0ZXZnjTYcD4MsBQFETDaYcRfeNhrqqsGz9FKTMu2u4FGrVwfu/xL++8Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750714848; c=relaxed/simple; bh=xH/dWtXBTnOp/bItFjyOXyWT/pQMcmN2o0xR0A5CGrs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=djBcmoiYSPaXR/5nB3A7OMixdqRQpxA55DzUYIKJ8AGnrpb9a4CrxfppbSFIhThlEu8zrB9FihhYceYXcmYqB75yyj7sjY3CyXOO+k0Iu0/dOpGq6ti0tuuYdXDRHMFuIBYGcitsghyQlP4M3PKDJRoNRo971bMLmyzJHOsY+ZI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=idXk/zHc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="idXk/zHc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D959C4CEEA; Mon, 23 Jun 2025 21:40:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750714848; bh=xH/dWtXBTnOp/bItFjyOXyWT/pQMcmN2o0xR0A5CGrs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=idXk/zHcCNLP4yXXpvzvrnfYNfL94EME3XypCwT/at1PrbZc64WTjBsl2FUBR2iaD U1K0RnYrOC4jw2k+/sxAP2uvVBzlfxxTAKRmZgkzz2GBunuPJBYS0G4DI1yJGpCMBG ZZzF3Q/ldW8d3DeVLrGB9eUHUcbawQwPGtE5SU48= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Eric Dumazet , Wei Wang , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10 257/355] tcp: fix initial tp->rcvq_space.space value for passive TS enabled flows Date: Mon, 23 Jun 2025 15:07:38 +0200 Message-ID: <20250623130634.482489182@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130626.716971725@linuxfoundation.org> References: <20250623130626.716971725@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet [ Upstream commit cd171461b90a2d2cf230943df60d580174633718 ] tcp_rcv_state_process() must tweak tp->advmss for TS enabled flows before the call to tcp_init_transfer() / tcp_init_buffer_space(). Otherwise tp->rcvq_space.space is off by 120 bytes (TCP_INIT_CWND * TCPOLEN_TSTAMP_ALIGNED). Signed-off-by: Eric Dumazet Reviewed-by: Wei Wang Link: https://patch.msgid.link/20250513193919.1089692-7-edumazet@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/ipv4/tcp_input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index ad91377f6cfae..f239310e91590 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -6512,6 +6512,9 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) if (!tp->srtt_us) tcp_synack_rtt_meas(sk, req); + if (tp->rx_opt.tstamp_ok) + tp->advmss -= TCPOLEN_TSTAMP_ALIGNED; + if (req) { tcp_rcv_synrecv_state_fastopen(sk); } else { @@ -6536,9 +6539,6 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb) tp->snd_wnd = ntohs(th->window) << tp->rx_opt.snd_wscale; tcp_init_wl(tp, TCP_SKB_CB(skb)->seq); - if (tp->rx_opt.tstamp_ok) - tp->advmss -= TCPOLEN_TSTAMP_ALIGNED; - if (!inet_csk(sk)->icsk_ca_ops->cong_control) tcp_update_pacing_rate(sk); -- 2.39.5