mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: omar@blockcast.net
Cc: ap420073@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	shuah@kernel.org, horms@kernel.org, netdev@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	willemb@google.com
Subject: Re: [PATCH net-next v4 05/12] amt: forward multicast data over IPv6
Date: Mon, 30 Nov 2026 03:48:32 +0000	[thread overview]
Message-ID: <179601051244.3146.8134195674516208005@kernel.org> (raw)
In-Reply-To: <20261129034652.1853485-6-omar@blockcast.net>

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

  reply	other threads:[~2026-11-30  3:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29  3:46 [PATCH net-next v4 00/12] amt: add an IPv6 outer transport Omar Ramadan
2026-11-29  3:46 ` [PATCH net-next v4 01/12] amt: create an AF_INET6 encapsulation socket for an IPv6 outer address Omar Ramadan
2026-11-29  3:46 ` [PATCH net-next v4 02/12] amt: send the Relay Advertisement over IPv6 Omar Ramadan
2026-11-30  3:48   ` netdev-bot+sashiko
2026-11-30  6:41     ` Omar Ramadan
2026-11-29  3:46 ` [PATCH net-next v4 03/12] amt: key relay tunnels on a union amt_addr endpoint Omar Ramadan
2026-11-29  3:46 ` [PATCH net-next v4 04/12] amt: send the Membership Query over IPv6 Omar Ramadan
2026-11-29  3:46 ` [PATCH net-next v4 05/12] amt: forward multicast data " Omar Ramadan
2026-11-30  3:48   ` netdev-bot+sashiko [this message]
2026-11-30  6:41     ` Omar Ramadan
2026-11-29  3:46 ` [PATCH net-next v4 06/12] amt: size the encapsulation headroom by the outer IP version Omar Ramadan
2026-11-29  3:46 ` [PATCH net-next v4 07/12] amt: send the AMT gateway control plane over IPv6 Omar Ramadan
2026-11-29  3:46 ` [PATCH net-next v4 08/12] amt: receive " Omar Ramadan
2026-11-29  3:46 ` [PATCH net-next v4 09/12] amt: add netlink attributes for an IPv6 outer transport Omar Ramadan
2026-11-29  3:46 ` [PATCH net-next v4 10/12] MAINTAINERS: amt: cover the amt headers and selftests Omar Ramadan
2026-11-29  3:46 ` [PATCH net-next v4 11/12] selftests: net: add amt_v6.sh for an IPv6 outer transport Omar Ramadan
2026-11-30  3:48   ` netdev-bot+sashiko
2026-11-30  6:41     ` Omar Ramadan
2026-11-29  3:46 ` [PATCH net-next v4 12/12] selftests: net: add amt_gw_v6.sh for the IPv6 netlink attributes Omar Ramadan
2026-11-30  3:48   ` netdev-bot+sashiko

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=179601051244.3146.8134195674516208005@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=ap420073@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=omar@blockcast.net \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=willemb@google.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

all inboxes | Powered by JetHome®