From: Mariusz Klimek <maklimek97@gmail.com>
To: netdev@vger.kernel.org
Cc: pabeni@redhat.com, Mariusz Klimek <maklimek97@gmail.com>
Subject: [PATCH net-next v2 1/3] net: gso: do not include jumbogram HBH header in seglen calculation
Date: Tue, 6 Jan 2026 10:52:41 +0100 [thread overview]
Message-ID: <20260106095243.15105-2-maklimek97@gmail.com> (raw)
In-Reply-To: <20260106095243.15105-1-maklimek97@gmail.com>
This patch fixes an issue in skb_gso_network_seglen and similar functions
where the calculated segment length includes the HBH headers of BIG TCP
jumbograms despite these headers being removed before segmentation. These
headers are added by GRO or by ip6_xmit for BIG TCP packets and are later
removed by GSO. This bug causes MTU validation of BIG TCP jumbograms to
fail.
Signed-off-by: Mariusz Klimek <maklimek97@gmail.com>
---
net/core/gso.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/net/core/gso.c b/net/core/gso.c
index bcd156372f4d..deacd32f644d 100644
--- a/net/core/gso.c
+++ b/net/core/gso.c
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-or-later
+#include <linux/if_vlan.h>
#include <linux/skbuff.h>
#include <linux/sctp.h>
#include <net/gso.h>
@@ -177,8 +178,13 @@ static unsigned int skb_gso_transport_seglen(const struct sk_buff *skb)
*/
static unsigned int skb_gso_network_seglen(const struct sk_buff *skb)
{
- unsigned int hdr_len = skb_transport_header(skb) -
- skb_network_header(skb);
+ unsigned int off = skb_network_offset(skb) + sizeof(struct ipv6hdr);
+ unsigned int hdr_len = skb_network_header_len(skb);
+
+ /* Jumbogram HBH header is removed upon segmentation. */
+ if (skb_protocol(skb, true) == htons(ETH_P_IPV6) &&
+ skb->len - off > IPV6_MAXPLEN)
+ hdr_len -= sizeof(struct hop_jumbo_hdr);
return hdr_len + skb_gso_transport_seglen(skb);
}
@@ -194,9 +200,7 @@ static unsigned int skb_gso_network_seglen(const struct sk_buff *skb)
*/
static unsigned int skb_gso_mac_seglen(const struct sk_buff *skb)
{
- unsigned int hdr_len = skb_transport_header(skb) - skb_mac_header(skb);
-
- return hdr_len + skb_gso_transport_seglen(skb);
+ return skb_mac_header_len(skb) + skb_gso_network_seglen(skb);
}
/**
--
2.47.3
next prev parent reply other threads:[~2026-01-06 9:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-06 9:52 [PATCH net-next v2 0/3] net: gso: fix MTU validation of BIG TCP Mariusz Klimek
2026-01-06 9:52 ` Mariusz Klimek [this message]
2026-01-13 8:40 ` [PATCH net-next v2 1/3] net: gso: do not include jumbogram HBH header in seglen calculation Paolo Abeni
2026-01-13 13:51 ` Paolo Abeni
2026-01-14 3:47 ` Jason Wang
2026-01-13 14:14 ` Paolo Abeni
2026-01-14 15:52 ` Mariusz Klimek
2026-01-06 9:52 ` [PATCH net-next v2 2/3] ipv6: remove IP6SKB_FAKEJUMBO flag Mariusz Klimek
2026-01-06 9:52 ` [PATCH net-next v2 3/3] selftests/net: remove unnecessary MTU config in big_tcp.sh Mariusz Klimek
2026-01-13 21:42 ` [PATCH net-next v2 0/3] net: gso: fix MTU validation of BIG TCP Alice Mikityanska
2026-01-30 8:57 ` Mariusz Klimek
2026-01-30 18:02 ` Alice Mikityanska
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=20260106095243.15105-2-maklimek97@gmail.com \
--to=maklimek97@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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