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 v5 05/12] amt: forward multicast data over IPv6
Date: Tue, 01 Dec 2026 06:46:20 +0000 [thread overview]
Message-ID: <179610758035.3146.14075065452225210668@kernel.org> (raw)
In-Reply-To: <20261130064249.1874523-6-omar@blockcast.net>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1
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_send_multicast_data() (drivers/net/amt.c), a tunnel's
MTU is dst_mtu() of the route to the gateway minus 50 (amt_tmtu(),…
- [Low] The commit message of "amt: forward multicast data over IPv6"
describes the IPv6 Multicast Data path as if it takes effect here.
--
amt: forward multicast data over IPv6
This commit sends the relay's copy of a multicast packet through
amt_udp_xmit(), so it can go over an IPv6 outer transport. Over IPv6 it
looks up the route first and drops a payload that exceeds the route MTU
less the outer and AMT headers. After walking all tunnels it sends one
ICMPv6 Packet Too Big to an IPv6 source.
> amt_send_multicast_data() routes and transmits the relay's copy of a
> multicast packet only over IPv4, so an IPv6 relay could establish
> tunnels but not deliver traffic through them.
[ ... ]
> sent is still freed, but it is now counted in tx_dropped, and one for
> which amt_udp_xmit() finds no route is freed with a drop reason; before,
> nothing recorded the drop, as amt_dev_xmit() returns NETDEV_TX_OK for
> the packet.
[Severity: Low]
This isn't a bug, but is this description accurate for this commit?
At this point nothing writes amt->local_ipv6, so amt_v6() is false for
every device:
drivers/net/amt.c:amt_v6() {
return IS_ENABLED(CONFIG_IPV6) && !ipv6_addr_any(&amt->local_ipv6);
}
So none of these can run yet:
- the new IPv6 branch of amt_send_multicast_data()
- amt_tmtu() and amt_tmtu_exceeded()
- the icmpv6_ndo_send() call in amt_dev_xmit()
They only become reachable once "amt: add netlink attributes for an IPv6
outer transport" adds IFLA_AMT_LOCAL_IP6. The other patches in the series
before that one say that amt_v6() is still false, or that there is no
functional change.
The changes that do take effect here all hit existing IPv4-outer relays:
- tx_dropped is now counted on copy, offload and route failures.
- A no-route drop now carries SKB_DROP_REASON_IP_OUTNOROUTES. The old
kfree_skb() already recorded a drop with NOT_SPECIFIED, so "nothing
recorded the drop" is only true of the device stats.
- For IPv6-inner multicast data, amt_dev_xmit() now restores the transport
header after ipv6_mc_check_mld(). skb_reset_inner_headers() then copies
that offset into inner_transport_header of the IPv4 UDP tunnel skb.
The commit message explains the transport header restore only as input to
the IPv6 MTU check, which can't run yet.
Could the message say which changes take effect at this commit? Could it
also say that the restore changes how IPv4 relays handle IPv6 multicast?
> diff --git a/drivers/net/amt.c b/drivers/net/amt.c
> index 8da1e73b1655e..cfd8e02772648 100644
> --- a/drivers/net/amt.c
> +++ b/drivers/net/amt.c
> @@ -1254,26 +1254,55 @@ static void amt_req_work(struct work_struct *work)
> msecs_to_jiffies(100));
> }
>
> +/* RFC 7450 s5.3.3.6: a Multicast Data message sent over IPv6 must not
> + * carry a Fragment header, so a payload larger than the tunnel MTU is
> + * dropped, and an IPv6 source is sent a Packet Too Big, unless the tunnel
> + * MTU is below IPV6_MIN_MTU, which a source would ignore. An IPv4 source is
> + * not told, as icmp_send() never answers a multicast datagram. The tunnel
> + * MTU follows the route's path MTU, as on every IPv6 UDP tunnel.
> + */
> +static u32 amt_tmtu(const struct dst_entry *dst)
> +{
> + u32 hlen = sizeof(struct ipv6hdr) + sizeof(struct udphdr) +
> + sizeof(struct amt_header_mcast_data);
> + u32 mtu = dst_mtu(dst);
> +
> + return mtu > hlen ? mtu - hlen : 0;
> +}
[ ... ]
> @@ -1374,26 +1403,60 @@ static bool amt_send_membership_update(struct amt_dev *amt,
[ ... ]
> + if (amt_v6(amt)) {
> + u32 tmtu;
> +
> + dst = amt_route6(amt, sk, &amt->local_ipv6, &tunnel->addr.ip6,
> + amt->relay_port, tunnel->source_port);
[ ... ]
> + tmtu = amt_tmtu(dst);
> + if (amt_tmtu_exceeded(oskb, tmtu)) {
> + dst_release(dst);
> + /* A source ignores a Packet Too Big below
> + * IPV6_MIN_MTU, so a tunnel that small is only
> + * dropped for.
> + */
> + if (tmtu >= IPV6_MIN_MTU && (!*ptb || tmtu < *ptb))
> + *ptb = tmtu;
> + DEV_STATS_INC(amt->dev, tx_dropped);
> + return;
> + }
> + }
[ ... ]
> @@ -1593,8 +1654,10 @@ static netdev_tx_t amt_dev_xmit(struct sk_buff *skb, struct net_device *dev)
> }
> continue;
> found:
> - amt_send_multicast_data(amt, skb, tunnel, v6);
> + amt_send_multicast_data(amt, skb, tunnel, v6, &ptb);
> }
> + if (ptb && v6)
> + icmpv6_ndo_send(skb, ICMPV6_PKT_TOOBIG, 0, ptb);
[Severity: Medium]
Can an off-path sender make the relay send a multicast source a Packet Too
Big with a value of the sender's choosing?
amt_tmtu() takes the tunnel MTU from dst_mtu() of the route to the
gateway. udpv6_err() lowers that route's MTU for every Packet Too Big,
before it looks up a socket:
net/ipv6/udp.c:udpv6_err() {
...
udpv6_err_update_exception(net, skb, type, info);
...
}
The gateway address can belong to an unauthenticated AMT gateway, which a
relay accepts by design, or to any existing tunnel.
Take a forged Packet Too Big with MTU M, where 1330 <= M < 1490, naming a
gateway that has joined group G. The 1490 bound assumes the 1440 device
MTU at the end of the series on a 1500 link. That tunnel's MTU becomes
M - 50, which is at least IPV6_MIN_MTU.
Every IPv6 packet of G larger than that would then make amt_dev_xmit()
send the source a Packet Too Big carrying M - 50.
icmp6_send() allows a Packet Too Big for a multicast destination:
net/ipv6/icmp.c:icmp6_send() {
...
if (addr_type & IPV6_ADDR_MULTICAST || skb->pkt_type != PACKET_HOST) {
if (type != ICMPV6_PKT_TOOBIG &&
!(type == ICMPV6_PARAMPROB &&
code == ICMPV6_UNK_OPTION &&
(opt_unrec(skb, info))))
goto out;
...
}
Packet Too Big is also cleared from the default icmpv6_ratemask, so these
messages are not rate limited.
The source would then lower its PMTU for the group address itself. That
affects every receiver of G, including native LAN receivers and the other
AMT tunnels, not just the gateway whose path was forged. The source would
have to fragment, and senders using IPV6_DONTFRAG would get EMSGSIZE.
The Packet Too Big also goes to any IPv6 source. RFC 7450 s5.3.3.6.2.2
asks for one only for an SSM source.
The commit message only covers the minimum forged value:
therefore lowers the tunnel MTU to 1280 bytes less the 50 of the
IPv6, UDP and AMT headers, 1230, until the route exception expires,
10 minutes by default. Every multicast payload above that, IPv4 or
IPv6, is then dropped toward that gateway, and its source is told
nothing, as 1230 is below the 1280 a Packet Too Big can ask for.
Is it intended that a slightly larger forged MTU gets passed on to the
source?
At this commit amt_v6() is still false. The code is unchanged at the end
of the series, where IFLA_AMT_LOCAL_IP6 makes it reachable.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130064249.1874523-1-omar%40blockcast.net
next prev parent reply other threads:[~2026-12-01 6:46 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 6:42 [PATCH net-next v5 00/12] amt: add an IPv6 outer transport Omar Ramadan
2026-11-30 6:42 ` [PATCH net-next v5 01/12] amt: create an AF_INET6 encapsulation socket for an IPv6 outer address Omar Ramadan
2026-11-30 6:42 ` [PATCH net-next v5 02/12] amt: send the Relay Advertisement over IPv6 Omar Ramadan
2026-12-01 6:46 ` netdev-bot+sashiko
2026-11-30 6:42 ` [PATCH net-next v5 03/12] amt: key relay tunnels on a union amt_addr endpoint Omar Ramadan
2026-12-01 6:46 ` netdev-bot+sashiko
2026-11-30 6:42 ` [PATCH net-next v5 04/12] amt: send the Membership Query over IPv6 Omar Ramadan
2026-11-30 6:42 ` [PATCH net-next v5 05/12] amt: forward multicast data " Omar Ramadan
2026-12-01 6:46 ` netdev-bot+sashiko [this message]
2026-11-30 6:42 ` [PATCH net-next v5 06/12] amt: size the encapsulation headroom by the outer IP version Omar Ramadan
2026-11-30 6:42 ` [PATCH net-next v5 07/12] amt: send the AMT gateway control plane over IPv6 Omar Ramadan
2026-11-30 6:42 ` [PATCH net-next v5 08/12] amt: receive " Omar Ramadan
2026-12-01 6:46 ` netdev-bot+sashiko
2026-11-30 6:42 ` [PATCH net-next v5 09/12] amt: add netlink attributes for an IPv6 outer transport Omar Ramadan
2026-11-30 6:42 ` [PATCH net-next v5 10/12] MAINTAINERS: amt: cover the amt headers and selftests Omar Ramadan
2026-11-30 6:42 ` [PATCH net-next v5 11/12] selftests: net: add amt_v6.sh for an IPv6 outer transport Omar Ramadan
2026-12-01 6:46 ` netdev-bot+sashiko
2026-11-30 6:42 ` [PATCH net-next v5 12/12] selftests: net: add amt_gw_v6.sh for the IPv6 netlink attributes Omar Ramadan
2026-12-01 6:46 ` netdev-bot+sashiko
2026-11-30 17:27 ` [PATCH net-next v5 00/12] amt: add an IPv6 outer transport Matthieu Baerts
2026-12-01 8:48 ` Matthieu Baerts
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=179610758035.3146.14075065452225210668@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®