From: Chris Mason <mason@kernel.org>
To: mason@kernel.org, edumazet@kernel.org, ncardwell@google.com,
kuniyu@google.com, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, willemb@google.com,
josef@toxicpanda.com, netdev@vger.kernel.org
Subject: [PATCH net 0/3] tcp: avoid integer wraps in the RTT estimator and the RTO
Date: Tue, 17 Nov 2026 19:50:48 -0500 [thread overview]
Message-ID: <20261118005048.53393-1-mason@kernel.org> (raw)
Hi everyone,
These three patches keep large RTT samples from wrapping the u32 fields
of the TCP RTT estimator.
Patch 1: __tcp_set_rto() never returns 0, so that the backoff recovers
from any state of the RTT estimator.
Patch 2: tcp_rtt_estimator() clamps each sample to 120 s, so that
srtt_us, mdev_us, rttvar_us and the sum in __tcp_set_rto() can't wrap.
This covers the ACK, SACK and TSecr samples.
Patch 3: tcp_rtt_tsopt_us() rejects a TSecr sample above 120 s.
Thanks to Eric for suggesting patches 1 and 2. This is on top of
v7.4-rc3.
Chris Mason (3):
tcp: don't let __tcp_set_rto() return 0
tcp: clamp RTT samples in tcp_rtt_estimator()
tcp: reject RTT samples from TSecr above 120 s
include/net/tcp.h | 11 ++++++++++-
net/ipv4/tcp_input.c | 12 +++++++-----
2 files changed, 17 insertions(+), 6 deletions(-)
--
2.55.0
next reply other threads:[~2026-11-18 0:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 0:50 Chris Mason [this message]
2026-11-18 0:50 ` [PATCH net 1/3] tcp: don't let __tcp_set_rto() return 0 Chris Mason
2026-11-18 0:50 ` [PATCH net 2/3] tcp: clamp RTT samples in tcp_rtt_estimator() Chris Mason
2026-11-18 0:50 ` [PATCH net 3/3] tcp: reject RTT samples from TSecr above 120 s Chris Mason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261118005048.53393-1-mason@kernel.org \
--to=mason@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=josef@toxicpanda.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox