netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] net: gso: fix MTU validation of BIG TCP jumbograms
@ 2025-11-27  9:13 Mariusz Klimek
  2025-11-27  9:13 ` [PATCH net-next 1/3] net: gso: do not include jumbogram HBH header in seglen calculation Mariusz Klimek
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Mariusz Klimek @ 2025-11-27  9:13 UTC (permalink / raw)
  To: netdev; +Cc: Mariusz Klimek

This series fixes the MTU validation of BIG TCP jumbograms and removes the
existing IP6SKB_FAKEJUMBO work-around that only fixes the issue in one
location.

For GSO packets, the length that matters for MTU validation is the segment
length, not the total length of the packet. skb_gso_network_seglen is used
by skb_gso_validate_network_len to calculate the segment length including
the network and transport headers and to then verify that the segment
length is below the MTU.

skb_gso_network_seglen assumes that the headers of the segments are
identical to those of the unsegmented packet, but that assumption is
incorrect for BIG TCP jumbograms which have an added HBH header that is
removed upon segmentation. The calculated segment length ends up being 8
bytes more than the actual segment length.

The actual segment length is set according to the MSS, so the segment
length calculated by skb_gso_network_seglen is greater than the MTU,
causing the skb_gso_validate_network_len check to fail despite the fact
that the actual segment length is lower than the MTU.

There is currently a work-around that fixes this bug in some cases:
ip6_xmit sets the IP6SKB_FAKEJUMBO flag for BIG TCP jumbograms, which
causes the MTU validation in ip6_finish_output_gso to be skipped
(intentionally). However, this work-around doesn't apply to MTU validations
performed in other places such as in ip6_forward. BIG TCP jumbograms don't
pass the MTU validation when forwarded locally and are therefore dropped,
unless the MTU of the originating interface is lower than the MTUs of the
rest of the interfaces the packets are forwarded through.

Mariusz Klimek (3):
  net: gso: do not include jumbogram HBH header in seglen calculation
  ipv6: remove IP6SKB_FAKEJUMBO flag
  selftests/net: remove unnecessary MTU config in big_tcp.sh

 include/linux/ipv6.h                   | 1 -
 net/core/gso.c                         | 4 ++++
 net/ipv6/ip6_output.c                  | 4 +---
 tools/testing/selftests/net/big_tcp.sh | 1 -
 4 files changed, 5 insertions(+), 5 deletions(-)

-- 
2.47.3


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-12-02 20:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-27  9:13 [PATCH net-next 0/3] net: gso: fix MTU validation of BIG TCP jumbograms Mariusz Klimek
2025-11-27  9:13 ` [PATCH net-next 1/3] net: gso: do not include jumbogram HBH header in seglen calculation Mariusz Klimek
2025-12-02 11:36   ` Paolo Abeni
2025-12-02 12:06     ` Paolo Abeni
2025-12-02 16:55       ` Mariusz Klimek
2025-12-02 16:41     ` Mariusz Klimek
2025-12-02 20:34       ` Paolo Abeni
2025-11-27  9:13 ` [PATCH net-next 2/3] ipv6: remove IP6SKB_FAKEJUMBO flag Mariusz Klimek
2025-11-27  9:13 ` [PATCH net-next 3/3] selftests/net: remove unnecessary MTU config in big_tcp.sh Mariusz Klimek
2025-12-02 12:01   ` Paolo Abeni
2025-12-02 16:46     ` Mariusz Klimek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).