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=1796272400; b=mprKbQXaOkR0soXDgvpkRDb7B+x3ae4GZZnSR3u/tSYtsc1wpBWlp2tVkuQ1HxaGJ1Uf A2G08EriAgzqjtWtG5QKMGnxvJB65Oe5KiNDlnJ8zeWZkEhST58vnqBTYZYzSnjWGQDKw sfb0sTOUHir+F5/fPh//sQZ69z/niHDaJRPKo7hBzuGWWGDW+ivQq+4pAKZWvbVYvmz3C 7WHL+gYRfRXrXNRoU+L6N50rA2p1KQro1WKX/hTozq3LDkqIuJHNY2ZqkGRYN8IydQ9tG Tm+fi4JqajLxYlSLqsO5dknM8yKzAVFfiEpnqWHI2zeBFrUs2a6d7GawHqBgn5ktTRQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796272400; 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=M6Hu/1+zPcherXpXwJkaz57zBBqHwewclWd1fLlSCK0=; b=qWIEpxn9rp/dhULFZNXQ9Lse2koJlbMw1Ew3VeIkiPyt1Sfc/E3iPWkRWmSKzXKlDuLB Evvl7joPK2bscWH1PR7ZXfn1nBAoqWYOfsOjYkVmUmpsUusD8mA1SeilHpbDBsFqjSFzD FemA1BExGw2QHZ9qSF1AsS42FDTWSUxxAjsJVItyZ6C0YK3eom/qVGRaaL3s1KDLQvB9g Rp5pCy8zYq85QHsl8Z6k9MIb+P1PFdi8Qs9kfu6fwNVVhnB6AyMjXmHUsbrOLkAe5a1XK /1AFwTJIaD0bJ7ruzu3KT/td3svB3czhenn/BbXqiZNkOPGCAKBig3001Q7mzWBkrEA== 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=eK7PGfuy; 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 63FF2606A697; Thu, 3 Dec 2026 04:33:20 +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=eK7PGfuy Received: by smtp.kernel.org (Postfix) with ESMTPSA id 329B81F000C1; Thu, 3 Dec 2026 04:33:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796272400; bh=M6Hu/1+zPcherXpXwJkaz57zBBqHwewclWd1fLlSCK0=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=eK7PGfuy7OlSbGjz9pCMLARljgTIhHJ6RySR77KXo6W/J1P0Axz+8hSgENhfqzyvi PbLLdcemh4GBtRedWX8ocyhsc86mH3+MOU+pULFyaz7qjqjLLzq0YS4+VfGJpiVJDS s3VBAIkkmlF+Bd6GxYVXJZ8lLgQ+Txu5T4JhIO1kQm1LS3BBktILsZMOgsX88C6GDF sfUnPkzmxdy4rjvnC+yR0+9RSwS14dCFIcsi1dYQHlr5bb3v/g0xvJPjxJ6BuuZlie eHKIpVxdsW9Hby/xYtyY29xf+6xR1+hXsllKpT8MvQsxXOgj5fsI4IQ+Ebe7QFmH4z HcHyGvwkAl/CA== Subject: Re: [PATCH net-next v6 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, dsahern@kernel.org, idosch@nvidia.com Date: Thu, 03 Dec 2026 04:33:18 +0000 Message-ID: <179627239875.3146.7780779712413401386@kernel.org> In-Reply-To: <20261202043200.286260-6-omar@blockcast.net> References: <20261202043200.286260-6-omar@blockcast.net> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-kernel@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] On an IPv6 outer transport, amt_send_multicast_data() (drivers/net/amt.c) silently drops an IPv4 multicast payload that… - [Low] Drops on the new IPv6 outer data path record no drop reason, so the kfree_skb tracepoint and drop monitors (dropwatch, perf… -- amt: forward multicast data over IPv6 This commit makes amt_send_multicast_data() send the relay's copies through amt_udp_xmit() over the outer family. Over IPv6, a payload above the tunnel MTU is dropped rather than fragmented. After walking every tunnel, amt_dev_xmit() sends one Packet Too Big for SSM groups. > diff --git a/drivers/net/amt.c b/drivers/net/amt.c > index 1f4914a635f48..1780d3dca1014 100644 > --- a/drivers/net/amt.c > +++ b/drivers/net/amt.c [ ... ] > @@ -1354,26 +1382,55 @@ static bool amt_send_membership_update(struct amt_dev *amt, > return false; > } > > +/* Send the relay's copy to one gateway. Over IPv6 a payload that does not > + * fit the tunnel MTU is dropped and *@ptb lowered to that MTU, for > + * amt_dev_xmit() to send one Packet Too Big after walking every tunnel. > + */ > static void amt_send_multicast_data(struct amt_dev *amt, > const struct sk_buff *oskb, > struct amt_tunnel_list *tunnel, > - bool v6) > + bool v6, u32 *ptb) > { [ ... ] > + if (amt_v6(amt)) { > + u32 tmtu; > + > + dst = amt_route6(amt, sk, &amt->local_ipv6, &tunnel->addr.ip6, > + amt->relay_port, tunnel->source_port); > + if (IS_ERR(dst)) { > + netdev_dbg(amt->dev, "no route to %pI6c\n", > + &tunnel->addr.ip6); > + DEV_STATS_INC(amt->dev, tx_dropped); > + return; > + } > + > + tmtu = amt_tmtu(dst); > + if (amt_tmtu_exceeded(oskb, tmtu)) { > + dst_release(dst); > + /* A Packet Too Big below IPV6_MIN_MTU is ignored. */ > + if (tmtu >= IPV6_MIN_MTU && (!*ptb || tmtu < *ptb)) > + *ptb = tmtu; > + DEV_STATS_INC(amt->dev, tx_dropped); > + return; > + } > + } [Severity: Medium] On an IPv6 outer transport, what happens here to an IPv4 inner payload (v6 == false) that exceeds tmtu? It is dropped and only tx_dropped is incremented. *ptb may be updated, but amt_dev_xmit() only uses it for IPv6 SSM groups: if (ptb && v6 && amt_group6_is_ssm(&group.ip6)) icmpv6_ndo_send(skb, ICMPV6_PKT_TOOBIG, 0, ptb); The IPv4 source therefore gets no signal at all. The commit message justifies this with: An IPv4 payload is dropped without an ICMP error, as icmp_send() does not answer multicast, and is not fragmented first (s5.3.3.6.2.1), as the IPv4 tunnel does not either. Is the comparison with the IPv4 tunnel accurate? The IPv4 outer path in amt_udp_xmit() sends with df = 0 and has no tunnel MTU check: udp_tunnel_xmit_skb(rt, sk, skb, fl4.saddr, fl4.daddr, AMT_TOS, ip4_dst_hoplimit(&rt->dst), 0, sport, dport, false, false, 0); ip_fragment() fragments an oversized packet at the outer layer, and the packet is still delivered. An IPv4 payload sized between the tunnel MTU and the device MTU then reaches a gateway through an IPv4 relay, but is silently lost through an IPv6 relay. For example, take a 1500 byte stream device, where the device MTU is 1440 at the end of the series, and a 1480 byte path MTU toward a gateway. tmtu is then 1430, so IPv4 payloads of 1431 to 1440 bytes are dropped for that gateway. amt_v6() is still false at this commit. This becomes reachable with "amt: add netlink attributes for an IPv6 outer transport", and this code is unchanged at the end of the series. s5.3.3.6.2.1 asks for the inner IPv4 payload to be fragmented before encapsulation. Should the IPv6 transport do that for IPv4 inner packets, since outer fragmentation is not available there? [ ... ] > @@ -1407,17 +1454,12 @@ static void amt_send_multicast_data(struct amt_dev *amt, > skb_set_inner_protocol(skb, htons(ETH_P_IP)); > else > skb_set_inner_protocol(skb, htons(ETH_P_IPV6)); > - udp_tunnel_xmit_skb(rt, sk, skb, > - fl4.saddr, > - fl4.daddr, > - AMT_TOS, > - ip4_dst_hoplimit(&rt->dst), > - 0, > - amt->relay_port, > - tunnel->source_port, > - false, > - false, > - 0); > + err = amt_udp_xmit(amt, sk, skb, &tunnel->addr, amt->relay_port, > + tunnel->source_port, 0, dst); > + if (err) { > + DEV_STATS_INC(amt->dev, tx_dropped); > + kfree_skb_reason(skb, SKB_DROP_REASON_IP_OUTNOROUTES); > + } > } [Severity: Low] The commit message says "one with no route is freed with SKB_DROP_REASON_IP_OUTNOROUTES". Does that hold on the IPv6 path? When amt_v6() is true, the amt_route6() failure and the amt_tmtu_exceeded() drop both return before skb_copy_expand(). No skb is freed with a reason in either case. amt_udp_xmit() also never returns an error over IPv6 when it is given a dst. This kfree_skb_reason() can therefore only be reached when the IPv4 route lookup fails. amt_dev_xmit() then frees the original skb with dev_kfree_skb(), which is consume_skb(): dev_kfree_skb(skb); return NETDEV_TX_OK; So even when every tunnel copy was dropped, the packet is traced as consumed. Users of the kfree_skb tracepoint, such as dropwatch or perf skb:kfree_skb, would not see these drops. That includes the MTU drops that the commit message says a forged Packet Too Big can cause. Could these IPv6 drops record a drop reason? For example, SKB_DROP_REASON_PKT_TOO_BIG would fit the tunnel MTU case. -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202043200.286260-1-omar%40blockcast.net