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 B1618199FBA; Mon, 23 Jun 2025 22:21:51 +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=1750717311; cv=none; b=DcmbV6vhe9KzHE3ULsRzl0dMDLNGn8ynAL1h3bxwWS0udlquRU9uswj6+lxPK1mBRXErgm/CjwXOz59qsCOc4qvocsR4YL77lnmpbPh2HnSGOpKcSS9TuI74ztQA11skgNjDI51HPRcHjBGWdm6WPL/TcGTmrbrsWK4TFoEMKhc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750717311; c=relaxed/simple; bh=rf3abDnl2S3GrRxU8QgfFAcDLyD0gBBPGeR9dDxG6Hs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aE3chiHPGWMqVf/IZeKyiST/a82dG1YaZBv1b9HjwLeB1puu/lM2ZTI7kRqzYH1PCbNpADYdF2r7JBCpjEo7B7u39oMd3h+2WTopr4s7rAdpFQiFEEY+bTfCucH1209KTUK/7UQRgAZ+Z13/JnGR+pQCKjj3HD+9f2b8Mwj3xCY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0XwcVSuz; 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="0XwcVSuz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 495A8C4CEEA; Mon, 23 Jun 2025 22:21:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750717311; bh=rf3abDnl2S3GrRxU8QgfFAcDLyD0gBBPGeR9dDxG6Hs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0XwcVSuzRuJBLWZb3uVmRxwhcuxxjqaf6edumw/IfO8h3PvkW44poiUSkgP5etWM/ bxRFiXyvsCRZK07Wm2Kz/6lbqY6s30cB7z2yEjhuPrGyFjDQpg90txpTGS2sZyfCM/ XD77ZCm62imXn90nq6YNzz/9CzXG1+dv3hPA5QYY= 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.1 402/508] tcp: fix initial tp->rcvq_space.space value for passive TS enabled flows Date: Mon, 23 Jun 2025 15:07:27 +0200 Message-ID: <20250623130655.134595843@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130645.255320792@linuxfoundation.org> References: <20250623130645.255320792@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.1-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 1044e9bce2d88..2888aaae0d76f 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -6633,6 +6633,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 { @@ -6657,9 +6660,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