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 08A986136; Mon, 23 Jun 2025 21:38:19 +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=1750714699; cv=none; b=WbqVdifNUSoQbH5+1EF5b5aR5fBP2ZC7uDtvDNs2eWCFV49NYvpO6zxwjdfOHDvrADbVNPCPOhpzkVUMDNsSGZ6w1TbJUStf0iwlO50plo52GIPV/8+gSeAOjxCsL/qzzaA3zlaBr4ODwjrE6T0K3vhq59Nu0CLmgn4UFGzAt60= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750714699; c=relaxed/simple; bh=1igaAS4iEdkmcZ2uGfsZF/Br/izmVdZjl1EmHJuBZD4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s3OC0p1JU6IUdqoYkv9l2oafDvXUH7RC+bqd6q0XcZw7OnzWD171HoPti8NHkqjTuO+V0kPcxMxHxnPMvonguIJ1w/P25codxRS/nMrSQYc7WRcJAyLBm1XDd7FWBumLXlZrgWdSeDwIWhyIjGnCeYdWPVFXSMN55ALFR6pZFF8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CEgNbp+a; 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="CEgNbp+a" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94BA8C4CEEA; Mon, 23 Jun 2025 21:38:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750714698; bh=1igaAS4iEdkmcZ2uGfsZF/Br/izmVdZjl1EmHJuBZD4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CEgNbp+a6VT9RBnZ/iOePcEU4Ru+qfHTAZypDIiAfaK0QgaRzFlYpY/cUnDdYexe+ nsfP8yyStIf2GYiy6PLfBgyW9db5vDASAGuS69P66cH4p6DO4uR3PkmnAF8s0MrU8Q FRZplftb0VkhtvW7j1CYqHQyLiPC1jkVtSCPKkZI= 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 6.6 153/290] tcp: fix initial tp->rcvq_space.space value for passive TS enabled flows Date: Mon, 23 Jun 2025 15:06:54 +0200 Message-ID: <20250623130631.497732283@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130626.910356556@linuxfoundation.org> References: <20250623130626.910356556@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-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 994c563b35f32..66d6ad6d633c5 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -6699,6 +6699,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 { @@ -6723,9 +6726,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