From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 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== 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== 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 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) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C72C61F00897; Tue, 1 Dec 2026 06:46:20 +0000 (UTC) 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== Subject: Re: [PATCH net-next v5 05/12] amt: forward multicast data over IPv6 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 Date: Tue, 01 Dec 2026 06:46:20 +0000 Message-ID: <179610758035.3146.14075065452225210668@kernel.org> In-Reply-To: <20261130064249.1874523-6-omar@blockcast.net> References: <20261130064249.1874523-6-omar@blockcast.net> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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