Article View: linux.kernel.netdev
Article #25019Re: [PATCH net-next v5 05/12] amt: forward multicast data over IPv6
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 06:46
Date: Tue, 01 Dec 2026 06:46
207 lines
15479 bytes
15479 bytes
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
Technical Details
Message-ID:
<179610758035.3146.14075065452225210668@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374757-linux-kernel-netdev=dewy.ruReferences:
<20261130064249.1874523-6-omar@blockcast.net>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374757-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v5 05/12] amt: forward multicast data over IPv6 Date: Tue, 01 Dec 2026 06:46:20 +0000 Organization: Usenet Network Message-ID: <179610758035.3146.14075065452225210668@kernel.org> References: <20261130064249.1874523-6-omar@blockcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1639925"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:BxOEeSvFWn5Q74gBugV5Uv4syE4= sha256:FsMBn4AY2bQE/e/+HQ9hGouUG4a9dALwJscRMLUrRF4= sha1:V4YDVvVYF7uINeRNAOlwJ9BmN1k= sha256:yMIlC1oZVNd8c2gSEXNrUeI2jgeyW89xZGYWzZyQkHo= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 2ADC411727B; Tue, 1 Dec 2026 09:47:35 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dJ-o9zl2HoBT; Tue, 1 Dec 2026 09:47:31 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374757-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 5327E117277; Tue, 1 Dec 2026 09:47:23 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 522A32FF08; Tue, 1 Dec 2026 06:46:38 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796107587; b=J1rRF5pr6bHSZzsfJDr+U42ebrj+oFTHb3Zkg73W0E04Dh26aOf/+yVgunsLocafef9f hxySJ+q2SKrDe2RRkgtamm3eNNlaeh2E5eXuQRJ3vrfj0eBjAK9Yj9QN1edC3zwgz4o9v 3o/t1TI+1uBGoP1DJtlONfJejmKYEf97EOx5XT+1f7TKaK2sBGi/BEXyKoYegfWWEjSxM jgKWiyN9B+kauYLioNUj6v/toR3sa3W0/Rtyd4JGvjbL5BLOTTJRi6iifHyPCHRaCnyXX UgDgBmB4zSTCBRbq+yQNND3QQUUBWTD8NUt2Cd2Cs4dNfb0RfVXw0Zv3G8QU4x/vv5g== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796107587; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=PvOKceos141UXYUYCW8AcQF3/u8o1pp3yGa2ij2Sj6M=; b=K+jn1df2g3GDOJ8av72MwReY0R0hP5FejfwepWJIMVBANSZOQcCcjrVUn2Rzw13kEeIS bUFq7uZOyhX3rvAJ0lk9flQj9VGa3uMEgx4+EtBmK1Oprz3+/b9xyi7ujd1farJf11Zug ipJiJox9e9wXA0XuaZM/BvZ2KHNeXtXySThik15sJ53vqRztCi7yuKGe5gOgQ3eCOWhpz pzNSkebS4PNdT4gKRdr+PrZD8hPH02kcChmyDAfqbJvyl+xhiUY0d/iF7YgN9mpG27shZ uVcdvjSbfviDXsEUH6f87ZCkKwNAZe1ux+qlr3Nwn9Be/vUkHNsW5nsDc+OfFW2uDUw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FAci7Yu9; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D42E5606A6BB; Tue, 1 Dec 2026 06:46:27 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FAci7Yu9 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796107582; b=23yiW0poZdAAgQ0rXfbqVd8+mgUbw/VyYPOekBR4So+rJLfH6fIrpmJpAA/x3jLKICQP R8ssbI6/6wjGF+s2QGk1Qlf1aRVBCGZFD6lhsGOfDte1WUt2t7gVWR8NS3E8Kvmpi62xc ylSrg9SCzMO0qgA3D0l4/3p2Ao0g8Sg58OT36274vlK9kFiuF80jpUJyIz022jzk9f5WY RPJkwpypkczYfBiuAmA1K14mV0oyMMgd1hwPCW/6L20xRS1Pww9hn9nqYjnE9LdHM1JeH fngtW06tCYYxtuO3ygNQk87HPSasTboBeItlTjRdT5ljlicKyIPJmQuFcMddVTRdgeA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796107582; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=PvOKceos141UXYUYCW8AcQF3/u8o1pp3yGa2ij2Sj6M=; b=n6JSqeMPsZpdsMFK1noe4Dpek0LlOf9DPlarUPQAgaPc/9Ln/JsiixIq++TrjmgTSXkp q7DmqBVEvqklXifkbr3lZJSS9QT6WHF+7IeypWwNRXIAcwf8rsAfFqHOh8IQuiCKjSJSo Y3QrFD6/KOWoh0UfId7sZs8NMFx5rmIIaJX8FU2UEPTO2F/5o4OqJgd4mhLQMHnAd2MTQ xxYXpEGD04v+gaMV8YkQoYZVLe2NYOMJac3a5OFS8EBO/Le/5Cc1Uuh78+KRiWjNjdgHB KkNwzdorwGADeeY8L0tt56QYTpWBGip1kEEztgmSk7MITyHlpbwHtlzTp3UOgF9AHgg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FAci7Yu9; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0154E606A6A0; Tue, 1 Dec 2026 06:46:21 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C72C61F00897; Tue, 1 Dec 2026 06:46:20 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796107581; bh=PvOKceos141UXYUYCW8AcQF3/u8o1pp3yGa2ij2Sj6M=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=FAci7Yu9DMcOrK9reyJpGDngll6UAZ4Y8hjPXtaMtFj1kxRyeCzZ/brjdmJssljlt Yv8bWBOp6r95NuEvzkQBbTnN5T6bXAsao+lIg6yqQs2gLWIBTymUhRm6O2Dsek65l1 jjuGr67KMrwoT3+d6f+xYOs8KbLRJpgcsU78n/7N1PnExtpRgd4iViRjfVHE341NeU B5Uili936frXUykoIZrYIEpx+mLP2MpgSb6cank74ShTjqnCZSq8+zqyrlDbLrM9u0 Of66f8wNCKxeHEljiT7NBfwUJvuwHp1fHCoAB6dUVUG///uDCwcgG7z6TOFFi6Goq+ PWb2wz9K5ETKQ== X-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 X-In-Reply-To: <20261130064249.1874523-6-omar@blockcast.net> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list