From: Ren Wei <weir@nebusec.ai>
To: netdev@vger.kernel.org
Cc: edumazet@google.com, ncardwell@google.com, kuniyu@google.com,
davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
horms@kernel.org, vega@nebusec.ai, edragain@163.com,
weir@nebusec.ai
Subject: [PATCH net v2 0/1] tcp: clamp route advmss to TCP_MIN_MSS
Date: Wed, 19 Aug 2026 23:22:03 +0800 [thread overview]
Message-ID: <cover.1787074852.git.edragain@163.com> (raw)
From: Yong Wang <edragain@163.com>
Hi Linux kernel maintainers,
This is v2 of the fix for the divide-by-zero reachable from
tcp_select_initial_window() via undersized route-derived advmss.
The previous version only rejected undersized non-zero RTAX_ADVMSS
values at the route metric input point. As pointed out in review, that
does not fully fix the bug because the panic is still reachable through
the "default advmss" path when RTAX_ADVMSS is 0 and the effective
advmss is later driven down by route MTU and min_adv_mss.
This version fixes the bug in TCP by introducing a helper that clamps
route-derived advmss to TCP_MIN_MSS before it is consumed by the TCP
paths that derive advmss from dst metrics.
I tested this version in QEMU and confirmed that the previously
reproducible divide-by-zero no longer occurs on the advmss=0 +
small-MTU/min_adv_mss path.
Thanks,
Yong Wang
---
Changes in v2:
- drop the RTAX_ADVMSS input validation from previous version
- clamp route-derived advmss in TCP instead
- switch the relevant TCP IPv4/IPv6 call sites to the new helper
- drop the long reproducer script and crash log from the cover letter
v1 link: https://lore.kernel.org/all/2c3901162c65a1d85cc1756a83a458db834d70c1.1786610865.git.edragain@163.com/
Yong Wang (1):
tcp: clamp route advmss to TCP_MIN_MSS
include/net/tcp.h | 5 +++++
net/ipv4/tcp_ipv4.c | 2 +-
net/ipv4/tcp_minisocks.c | 2 +-
net/ipv4/tcp_output.c | 6 +++---
net/ipv6/tcp_ipv6.c | 2 +-
5 files changed, 11 insertions(+), 6 deletions(-)
--
2.53.0
next reply other threads:[~2026-08-19 15:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 15:22 Ren Wei [this message]
2026-08-19 15:22 ` [PATCH net v2 1/1] tcp: clamp route advmss to TCP_MIN_MSS Ren Wei
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=cover.1787074852.git.edragain@163.com \
--to=weir@nebusec.ai \
--cc=davem@davemloft.net \
--cc=edragain@163.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vega@nebusec.ai \
/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