netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mariusz Klimek <maklimek97@gmail.com>
To: netdev@vger.kernel.org
Cc: Mariusz Klimek <maklimek97@gmail.com>
Subject: [PATCH net-next 1/3] net: gso: do not include jumbogram HBH header in seglen calculation
Date: Thu, 27 Nov 2025 10:13:23 +0100	[thread overview]
Message-ID: <20251127091325.7248-2-maklimek97@gmail.com> (raw)
In-Reply-To: <20251127091325.7248-1-maklimek97@gmail.com>

This patch fixes an issue in skb_gso_network_seglen 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 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/core/gso.c b/net/core/gso.c
index bcd156372f4d..251a49181031 100644
--- a/net/core/gso.c
+++ b/net/core/gso.c
@@ -180,6 +180,10 @@ static unsigned int skb_gso_network_seglen(const struct sk_buff *skb)
 	unsigned int hdr_len = skb_transport_header(skb) -
 			       skb_network_header(skb);
 
+	/* Jumbogram HBH header is removed upon segmentation. */
+	if (skb->protocol == htons(ETH_P_IPV6) && skb->len > IPV6_MAXPLEN)
+		hdr_len -= sizeof(struct hop_jumbo_hdr);
+
 	return hdr_len + skb_gso_transport_seglen(skb);
 }
 
-- 
2.47.3


  reply	other threads:[~2025-11-27  9:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Mariusz Klimek [this message]
2025-12-02 11:36   ` [PATCH net-next 1/3] net: gso: do not include jumbogram HBH header in seglen calculation 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
2026-01-06  9:26       ` Mariusz Klimek

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=20251127091325.7248-2-maklimek97@gmail.com \
    --to=maklimek97@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).