Re: [PATCH net-next v4 05/12] amt: forward multicast data over IPv6
From: netdev-bot+sashiko
Date: Sun Nov 29 2026 - 22:49:21 EST
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] In amt_dev_xmit() (drivers/net/amt.c), the patch saves the
transport header before calling ipv6_mc_check_mld() and restores it…
--
amt: forward multicast data over IPv6
This commit makes the AMT relay send Multicast Data through
amt_udp_xmit(), so the data path works over IPv6 as well as IPv4. Over
IPv6 it routes first, drops payloads that do not fit the route MTU minus
the outer and AMT headers, and sends a single Packet Too Big to an IPv6
source. It also puts back the transport header that ipv6_mc_check_mld()
moved, so the per-segment GSO length check counts extension headers.
> diff --git a/drivers/net/amt.c b/drivers/net/amt.c
> index 8da1e73b1655e..bcd88203eeab9 100644
> --- a/drivers/net/amt.c
> +++ b/drivers/net/amt.c
[ ... ]
> @@ -1524,6 +1573,9 @@ static netdev_tx_t amt_dev_xmit(struct sk_buff *skb, struct net_device *dev)
> group.ip4 = ip_hdr(skb)->daddr;
> #if IS_ENABLED(CONFIG_IPV6)
> } else if (iph->version == 6) {
> + bool th_set = skb_transport_header_was_set(skb);
> + int th_off = th_set ? skb_transport_offset(skb) : 0;
> +
> ip6h = ipv6_hdr(skb);
> if (!ipv6_addr_is_multicast(&ip6h->daddr))
> goto free;
> @@ -1540,6 +1592,14 @@ static netdev_tx_t amt_dev_xmit(struct sk_buff *skb, struct net_device *dev)
> }
> } else {
> data = true;
> + /* ipv6_mc_check_mld() set the transport header
> + * just past the fixed IPv6 header, even when
> + * extension headers follow, which would make the
> + * segments of a GSO skb look shorter than they
> + * are. Put it back.
> + */
> + if (th_set)
> + skb_set_transport_header(skb, th_off);
[Severity: Medium]
Does the saved th_off actually account for extension headers on the
relay's usual input path, IPv6 multicast forwarded by ip6mr?
For received packets, ip6_rcv_core() in net/ipv6/ip6_input.c sets:
skb->transport_header = skb->network_header + sizeof(*hdr);
Only ipv6_parse_hopopts() moves it after that, and only past a
Hop-by-Hop header. Nothing on the ip6mr forwarding path moves it past a
Destination Options or Routing header.
ipv6_mc_check_exthdrs() also returns -ENOMSG right away when nexthdr is
not HOPOPTS. So for a forwarded packet with a Destination Options header,
th_off is still network + 40. Restoring it leaves the transport header at
the start of the extension header, which is the offset the comment says
it is undoing.
The skb then reaches amt_tmtu_exceeded():
amt_dev_xmit()
amt_send_multicast_data()
amt_tmtu_exceeded()
skb_gso_validate_network_len(oskb, tmtu)
For a UDP_L4 GSO skb, the segment length is computed as
(transport - network) + sizeof(struct udphdr) + gso_size. Can this
under-count each segment by the length of the extension headers, so that
segments up to that many bytes over the tunnel MTU pass the RFC 7450
s5.3.3.6.2.2 drop check, and the source never gets a Packet Too Big?
One way to hit this is an ingress device with rx-udp-gro-forwarding
enabled. ipv6_gro_receive() pulls the Destination Options header through
ipv6_gro_pull_exthdrs() and builds a UDP_L4 GSO skb, which ip6mr then
forwards to the amt device.
The same offset is then copied into inner_transport_header by
skb_reset_inner_headers() in amt_send_multicast_data():
> skb_reset_mac_header(skb);
> skb_reset_inner_headers(skb);
Would the outer skb_gso_validate_network_len() in ip6_finish_output_gso()
under-count the same way, letting outer segments larger than dst_mtu()
leave the relay unfragmented, only to be dropped by the link or a hop
further on?
This code is unchanged at the end of the series.
> }
> v6 = true;
> group.ip6 = ipv6_hdr(skb)->daddr;
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261129034652.1853485-1-omar%40blockcast.net