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
Subject: Re: [PATCH net-next v6 05/12] amt: forward multicast data over IPv6
Date: Thu, 03 Dec 2026 04:33:18 +0000 [thread overview]
Message-ID: <179627239875.3146.7780779712413401386@kernel.org> (raw)
In-Reply-To: <20261202043200.286260-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] 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
next prev parent reply other threads:[~2026-12-03 4:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 4:31 [PATCH net-next v6 00/12] amt: add an IPv6 outer transport Omar Ramadan
2026-12-02 4:31 ` [PATCH net-next v6 01/12] amt: create an AF_INET6 encapsulation socket for an IPv6 outer address Omar Ramadan
2026-12-02 4:31 ` [PATCH net-next v6 02/12] amt: send the Relay Advertisement over IPv6 Omar Ramadan
2026-12-02 4:31 ` [PATCH net-next v6 03/12] amt: key relay tunnels on a union amt_addr endpoint Omar Ramadan
2026-12-03 4:33 ` netdev-bot+sashiko
2026-12-02 4:31 ` [PATCH net-next v6 04/12] amt: send the Membership Query over IPv6 Omar Ramadan
2026-12-03 4:33 ` netdev-bot+sashiko
2026-12-02 4:31 ` [PATCH net-next v6 05/12] amt: forward multicast data " Omar Ramadan
2026-12-03 4:33 ` netdev-bot+sashiko [this message]
2026-12-02 4:31 ` [PATCH net-next v6 06/12] amt: size the encapsulation headroom by the outer IP version Omar Ramadan
2026-12-02 4:31 ` [PATCH net-next v6 07/12] amt: send the AMT gateway control plane over IPv6 Omar Ramadan
2026-12-03 4:33 ` netdev-bot+sashiko
2026-12-02 4:31 ` [PATCH net-next v6 08/12] amt: receive " Omar Ramadan
2026-12-03 4:33 ` netdev-bot+sashiko
2026-12-02 4:31 ` [PATCH net-next v6 09/12] amt: add netlink attributes for an IPv6 outer transport Omar Ramadan
2026-12-02 4:31 ` [PATCH net-next v6 10/12] MAINTAINERS: amt: cover the amt headers and selftests Omar Ramadan
2026-12-02 4:31 ` [PATCH net-next v6 11/12] selftests: net: add amt_v6.sh for an IPv6 outer transport Omar Ramadan
2026-12-03 4:33 ` netdev-bot+sashiko
2026-12-02 4:32 ` [PATCH net-next v6 12/12] selftests: net: add amt_gw_v6.sh for the IPv6 netlink attributes Omar Ramadan
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=179627239875.3146.7780779712413401386@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=ap420073@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--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®