From: Julius Bairaktaris <julius@bairaktaris.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, sdf.kernel@gmail.com,
willemb@google.com, willemdebruijn.kernel@gmail.com,
ncardwell@google.com, kuniyu@google.com,
alice.kernel@fastmail.im, wang.zhan@smartx.com,
marcelo.leitner@gmail.com, lucien.xin@gmail.com,
linux-sctp@vger.kernel.org, dsahern@kernel.org,
dahern@nvidia.com, steffen.klassert@secunet.com, nbd@nbd.name
Subject: [PATCH net v2 0/3] net: gso: segment length of encapsulated GSO packets
Date: Sun, 6 Dec 2026 10:23:24 +0100 [thread overview]
Message-ID: <cover.1796548830.git.julius@bairaktaris.de> (raw)
skb_gso_transport_seglen() returns the length of one segment of a GSO
packet, which the MTU checks of IPv4 and IPv6 forwarding and output
compare with the MTU. For an encapsulated packet it counts from the
inner transport header and adds the inner L4 header: fraglist GRO
leaves the inner transport header unset for the inner flow of a tunnel,
and the inner UDP and SCTP headers are not counted.
Patch 1 sets the inner transport header in the fraglist completion of
TCP and UDP GRO, IPv4 and IPv6.
Patch 2 counts the inner UDP header of encapsulated UDP GSO packets.
Patch 3 counts the SCTP header of encapsulated SCTP GSO packets.
Patch 1 is hit by tunnel traffic from the network (VXLAN, FOU/GUE, GRE,
IPIP, SIT) forwarded by a host whose ingress has rx-gro-list on: the
forwarded aggregates are dropped or their segments checked against the
MTU with a wrong length. Patches 2 and 3 are hit by UDP GSO packets in
a UDP tunnel and by SCTP over UDP, forwarded or sent over a smaller
MTU: segments of up to 8 or 12 bytes over the MTU leave whole and are
lost further on.
The bugs were found by Sashiko reviews of earlier versions of "ipmr:
forward GSO multicast packets".
Tested in QEMU (KVM) with network namespaces, on net (6902a2bb708c),
2 runs per case on net and with this series:
- VXLAN with an inner UDP or TCP flow over IPv4 or IPv6, outer UDP
checksum zero or set, rx-gro-list on the router, forwarded unicast
over a 1400-byte route, 1000 packets per case: net delivers 33 to 186
per case (12 cases); with this series all 1000 arrive with valid
outer and inner checksums, also with checksum offload on the egress.
- An SCTP association over UDP with a 1500-byte path MTU through a
router whose egress MTU is 1496 bytes: on net the router hands the
egress 17 to 20 (IPv4) and 28 (IPv6) GSO packets with segments of up
to 1500 bytes; with this series none.
- ip6gre_{flat,hier}{,_key,_keys}.sh: every test passes on net and
with this series.
Changes in v2:
- Resend as asked by Stanislav Fomichev; rebased on net 6902a2bb708c,
no code change. The ip6gre failures NIPA reported on v1 came from
another patch in the same NIPA branch.
- Cover letter: test results on the new base; trigger and impact
as prose.
- v1: https://lore.kernel.org/netdev/cover.1795884313.git.julius@bairaktaris.de/
Changes in v1, since "ipmr: forward GSO multicast packets" v6, whose
patches 1 and 3 are patches 1 and 2 here:
- Split out of the ipmr series (Willem de Bruijn).
- Patch 3 (new): count the SCTP header in the encapsulated branch of
skb_gso_transport_seglen() (Sashiko on v6 patch 3).
- Patches 1 and 2: name the IPv6 users of the segment length in the
commit message.
- ipmr v6: https://lore.kernel.org/netdev/cover.1795295554.git.julius@bairaktaris.de/
I used Claude (Anthropic) to help write these patches.
Julius Bairaktaris (3):
net: gro: set the inner transport header of encapsulated fraglist
packets
net: gso: count the inner UDP header of encapsulated UDP GSO packets
net: gso: count the SCTP header of encapsulated SCTP GSO packets
net/core/gso.c | 4 ++++
net/ipv4/tcp_offload.c | 3 +++
net/ipv4/udp_offload.c | 3 +++
net/ipv6/tcpv6_offload.c | 3 +++
net/ipv6/udp_offload.c | 3 +++
5 files changed, 16 insertions(+)
base-commit: 6902a2bb708c4075d3de6ec18ab6a5864c4c1aa2
--
2.53.0
next reply other threads:[~2026-12-06 9:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-06 9:23 Julius Bairaktaris [this message]
2026-12-06 9:23 ` [PATCH net v2 1/3] net: gro: set the inner transport header of encapsulated fraglist packets Julius Bairaktaris
2026-12-06 9:23 ` [PATCH net v2 2/3] net: gso: count the inner UDP header of encapsulated UDP GSO packets Julius Bairaktaris
2026-12-06 9:23 ` [PATCH net v2 3/3] net: gso: count the SCTP header of encapsulated SCTP " Julius Bairaktaris
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.1796548830.git.julius@bairaktaris.de \
--to=julius@bairaktaris.de \
--cc=alice.kernel@fastmail.im \
--cc=dahern@nvidia.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-sctp@vger.kernel.org \
--cc=lucien.xin@gmail.com \
--cc=marcelo.leitner@gmail.com \
--cc=nbd@nbd.name \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf.kernel@gmail.com \
--cc=steffen.klassert@secunet.com \
--cc=wang.zhan@smartx.com \
--cc=willemb@google.com \
--cc=willemdebruijn.kernel@gmail.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