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, dsahern@kernel.org,
idosch@nvidia.com, willemb@google.com,
willemdebruijn.kernel@gmail.com, kuniyu@google.com,
steffen.klassert@secunet.com
Subject: [PATCH net v7 0/2] ipmr: forward GSO multicast packets
Date: Sat, 28 Nov 2026 17:47:54 +0100 [thread overview]
Message-ID: <cover.1795882892.git.julius@bairaktaris.de> (raw)
With fraglist GRO or UDP GRO forwarding on, a routed IPv4 multicast
stream arrives as GSO packets. ipmr_prepare_xmit() drops every DF
aggregate larger than the MTU, and ip_encap() sets no tunnel GSO state,
so a GSO packet sent to a VIFF_TUNNEL vif is dropped during
segmentation.
Patch 1 sets up IPXIP4 GSO state, outer IP IDs and length in
ip_encap(), segments an already encapsulated GSO packet in software
before it, as an ipip device does, and completes the pending checksum
of an encapsulated packet that is not GSO.
Patch 2 lets DF GSO packets pass when their segments fit the MTU.
Per issue:
- Trigger: a multicast stream from the network, routed by a multicast
routing daemon (igmpproxy, smcroute, pimd; configured with
CAP_NET_ADMIN) while the ingress has rx-gro-list or
rx-udp-gro-forwarding on. Patch 1 needs a VIFF_TUNNEL vif, patch 2
DF set on the stream.
- Impact: the aggregated packets are dropped, patch 1 after counting
them as sent; no memory safety issue. CVSS 3.1: 3.7
(AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L).
- Until the fix lands: ethtool -K <ingress> rx-gro-list off
rx-udp-gro-forwarding off.
- Found: patch 1 by a Sashiko review of v1, patch 2 as packet loss on an
IPQ8074 router.
For UDP GSO packets that patch 1 encapsulates, and for encapsulated
ones that patch 2 lets pass, the MTU check of ip_finish_output_gso()
counts the inner UDP header with "net: gso: count the inner UDP header
of encapsulated UDP GSO packets" from the series "net: gso: segment
length of encapsulated GSO packets", posted beside this one; each
applies to net on its own.
Tested in QEMU (KVM) with network namespaces, on net (28a371228d4e),
with this series alone and together with the series above:
- FOU carrying SIT or IPIP, IPIP, GRE and VXLAN aggregates routed to a
plain and a tunnel vif, underlay segmenting in software or offering
segmentation, 1000 datagrams per case: net delivers every datagram to
both vifs in 2 of 10 cases (2 runs), v6 in 2 of 10 and hands the
underlay 39 to 73 GSO packets with three IP headers per offload case
(2 runs); with this series all 10, with valid checksums and distinct
outer IP IDs, no GSO packet with three IP headers on the underlay
(5 runs, one with KASAN).
- SCTP INIT chunks encapsulated in IPIP by tc BPF, routed to a tunnel
vif: 50 of 50 arrive with a wrong CRC32c with v6 (2 runs), all valid
on net (1 run) and with this series (5 runs).
- IPIP aggregates built by GRO (fraglist, UDP GRO forwarding, none)
routed to a plain and a tunnel vif: 1000 of 1000 on both, distinct
outer IDs (4 runs, one with KASAN, in which 37 datagrams of one case
were lost before the router and missed on both vifs alike).
- An MFC entry to a plain and a tunnel vif, 4000 datagrams per arm,
UDP_SEGMENT, fraglist GRO and UDP GRO forwarding, DF set and clear,
software and device segmentation: all 4000 on the plain vif, and 4000
IPIP packets with unique outer IDs or the 100 GSO packets whole on
the tunnel vif, all 12 arms (5 runs, one with KASAN).
- tools/testing/selftests/net/forwarding/ipmr: the same 14 of 22 cases
pass as on net (3 runs and 1 run; the IPv6 cases need
CONFIG_IPV6_MROUTE, which is not set here).
Changes in v7:
- Split: v6 patches 1 and 3 and a new SCTP case go to "net: gso:
segment length of encapsulated GSO packets" (Willem de Bruijn).
- Drop v6 patch 2: Willem's ab5b219a7340 ("net: gso: fall back to
skb_segment when fraglist cannot satisfy checksum") in net covers it;
the two Sashiko findings on it (SKB_GSO_TUNNEL_REMCSUM predicate, UDP
linearization) go with it.
- Patch 1: segment an encapsulated GSO packet with skb_gso_segment()
before ip_encap() on a tunnel vif, in ipmr_queue_fwd_xmit() and
ipmr_queue_output_xmit(), instead of dropping those without
SKB_GSO_IPXIP4 (Willem de Bruijn). This removes FOU/GUE aggregates
carrying IPIP or SIT being segmented with ip_encap()'s inner protocol
(Willem, Sashiko) and IPXIP4 aggregates with three IP headers reaching
a device that segments them (Willem), and GRE and UDP tunnel
aggregates are forwarded instead of dropped, so the commit message no
longer claims they were lost before (Sashiko).
- Patch 1: complete the pending checksum with skb_csum_hwoffload_help()
instead of skb_checksum_help(), which overwrote an SCTP CRC32c
(Willem de Bruijn, Sashiko).
- Patch 1: read the vif flags once per packet.
- Patch 1: name the fixed-ID case every iptunnel_handle_offloads()
caller shares and the net-next series that fixes it (Sashiko).
- Rebase onto net.
- v6: https://lore.kernel.org/netdev/cover.1795295554.git.julius@bairaktaris.de/
I used Claude (Anthropic) to help write these patches.
Julius Bairaktaris (2):
ipmr: set up GSO state for tunnel vifs
ipmr: do not drop GSO packets that fit the MTU after segmentation
net/ipv4/ipmr.c | 84 +++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 75 insertions(+), 9 deletions(-)
base-commit: 28a371228d4eb4857cc31eeb1a0d7d01e9c3ea2f
--
2.53.0
next reply other threads:[~2026-11-28 16:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 16:47 Julius Bairaktaris [this message]
2026-11-28 16:47 ` [PATCH net v7 1/2] ipmr: set up GSO state for tunnel vifs Julius Bairaktaris
2026-11-28 16:47 ` [PATCH net v7 2/2] ipmr: do not drop GSO packets that fit the MTU after segmentation 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.1795882892.git.julius@bairaktaris.de \
--to=julius@bairaktaris.de \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=steffen.klassert@secunet.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