From: Artem Dinaburg <artem@trailofbits.com>
To: stable@vger.kernel.org
Cc: davem@davemloft.net, edumazet@kernel.org, horms@kernel.org,
kuba@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com
Subject: [PATCH 6.18.y 1/5] net: init shinfo->gso_segs from qdisc_pkt_len_init()
Date: Wed, 25 Nov 2026 14:57:31 -0500 [thread overview]
Message-ID: <20261125195735.57472-2-artem@trailofbits.com> (raw)
In-Reply-To: <20261125195735.57472-1-artem@trailofbits.com>
From: Eric Dumazet <edumazet@google.com>
Date: Fri, 21 Nov 2025 08:32:44 +0000
[ Upstream commit be1b70ab21cbe8f8bb8ecf39eb34880882252773 ]
Qdisc use shinfo->gso_segs for their pkts stats in bstats_update(),
but this field needs to be initialized for SKB_GSO_DODGY users.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20251121083256.674562-3-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Stable-dep-of: 7fb4c1967011 ("net: pull headers in qdisc_pkt_len_segs_init()")
Signed-off-by: Artem Dinaburg <artem@trailofbits.com>
---
net/core/dev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index e4216b78a1a4..97a6ea8fcede 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4126,7 +4126,7 @@ EXPORT_SYMBOL_GPL(validate_xmit_skb_list);
static void qdisc_pkt_len_init(struct sk_buff *skb)
{
- const struct skb_shared_info *shinfo = skb_shinfo(skb);
+ struct skb_shared_info *shinfo = skb_shinfo(skb);
qdisc_skb_cb(skb)->pkt_len = skb->len;
@@ -4167,6 +4167,7 @@ static void qdisc_pkt_len_init(struct sk_buff *skb)
if (payload <= 0)
return;
gso_segs = DIV_ROUND_UP(payload, shinfo->gso_size);
+ shinfo->gso_segs = gso_segs;
}
qdisc_skb_cb(skb)->pkt_len += (gso_segs - 1) * hdr_len;
}
next prev parent reply other threads:[~2026-11-25 19:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 19:57 [PATCH 6.18.y 0/5] net: validate GSO headers and preserve XFRM inner offsets Artem Dinaburg
2026-11-25 19:57 ` Artem Dinaburg [this message]
2026-11-25 19:57 ` [PATCH 6.18.y 2/5] net: pull headers in qdisc_pkt_len_segs_init() Artem Dinaburg
2026-11-25 19:57 ` [PATCH 6.18.y 3/5] xfrm: Don't clobber inner headers when already set Artem Dinaburg
2026-11-25 19:57 ` [PATCH 6.18.y 4/5] net: harden qdisc_pkt_len_segs_init() against malicious GSO packets Artem Dinaburg
2026-11-25 19:57 ` [PATCH 6.18.y 5/5] net: reject a negative TCP header offset in qdisc_pkt_len_segs_init() Artem Dinaburg
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=20261125195735.57472-2-artem@trailofbits.com \
--to=artem@trailofbits.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@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