Netdev List
 help / color / mirror / Atom feed
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
Subject: Re: [PATCH net-next v2 08/12] amt: receive the AMT gateway control plane over IPv6
Date: Thu, 26 Nov 2026 19:17:02 +0000	[thread overview]
Message-ID: <179572062268.3135.2896747109290971474@kernel.org> (raw)
In-Reply-To: <20261125191450.2497936-9-omar@blockcast.net>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] This patch changes how an IPv4 gateway handles Relay
  Advertisements, and the commit message does not say so.

--

amt: receive the AMT gateway control plane over IPv6

This patch lets an IPv6 AMT gateway receive Advertisements, Membership
Queries and Multicast Data over an IPv6 outer header. The learned IPv6
relay address is published under a new seqlock. A zero UDP checksum is
now accepted only for Multicast Data on an IPv6 gateway.

> diff --git a/drivers/net/amt.c b/drivers/net/amt.c
> index 6158e13f5520f..7dd1d544ff14e 100644
> --- a/drivers/net/amt.c
> +++ b/drivers/net/amt.c

[ ... ]

> @@ -2662,27 +2719,48 @@ static bool amt_advertisement_handler(struct amt_dev *amt, struct sk_buff *skb)
>  	struct amt_header_advertisement *amta;
>  	int hdr_size;
>  
> -	hdr_size = sizeof(*amta) + sizeof(struct udphdr);
> +	/* The IPv6 form (RFC 7450 s5.1.2) has the same header and nonce, with
> +	 * a 16-byte relay address in place of ip4.
> +	 */
> +	hdr_size = sizeof(struct udphdr) +
> +		   (amt_v6(amt) ? sizeof(struct amt_header_advertisement_v6) :
> +				  sizeof(*amta));
>  	if (!pskb_may_pull(skb, hdr_size))
>  		return true;
>  
> -	amta = (struct amt_header_advertisement *)(udp_hdr(skb) + 1);
> -	if (!amta->ip4)
> +	/* The two forms differ only in their length, and the device's family
> +	 * picks one, so a message of the other form is not accepted.
> +	 */
> +	if (ntohs(udp_hdr(skb)->len) != hdr_size)
>  		return true;

[Severity: Low]
Is this new length check meant to apply to IPv4 gateways as well?

When amt_v6() is false, hdr_size is 8 + 12 = 20. With this check an IPv4
gateway now drops every Advertisement whose UDP length is not exactly 20.
That includes the 24-byte form that carries an IPv6 relay address.

Before this patch amt_advertisement_handler() only did a minimum
pskb_may_pull() and had no length check. An IPv4 gateway would accept the
24-byte form and store the first 32 bits of the IPv6 address as
remote_ip. It would then send its Requests to an unrelated IPv4 host.

The commit message says:

    The IPv4 comparison it replaces is the one "amt: reject a gateway Query
    or Data from 0.0.0.0" fixed in net for IPv4, so this patch carries only
    the IPv6 half.

It does not mention that IPv4 Advertisement parsing changes too. The check
is still unchanged at the end of the series.

If the old IPv4 mis-parse counts as a bug, could it be split out and sent
to net with a Fixes: tag, as was done for the 0.0.0.0 fix? Otherwise,
could the changelog state that the IPv4 behaviour changes?

>  
> +	amta = (struct amt_header_advertisement *)(udp_hdr(skb) + 1);
>  	if (amta->reserved || amta->version)
>  		return true;

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125191450.2497936-1-omar%40blockcast.net

  reply	other threads:[~2026-11-26 19:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 19:14 [PATCH net-next v2 00/12] amt: add an IPv6 outer transport Omar Ramadan
2026-11-25 19:14 ` [PATCH net-next v2 01/12] amt: create an AF_INET6 encapsulation socket for an IPv6 outer address Omar Ramadan
2026-11-25 19:14 ` [PATCH net-next v2 02/12] amt: send the Relay Advertisement over IPv6 Omar Ramadan
2026-11-26 19:16   ` netdev-bot+sashiko
2026-11-25 19:14 ` [PATCH net-next v2 03/12] amt: key relay tunnels on a union amt_addr endpoint Omar Ramadan
2026-11-26 19:16   ` netdev-bot+sashiko
2026-11-25 19:14 ` [PATCH net-next v2 04/12] amt: send the Membership Query over IPv6 Omar Ramadan
2026-11-26 19:16   ` netdev-bot+sashiko
2026-11-25 19:14 ` [PATCH net-next v2 05/12] amt: forward multicast data " Omar Ramadan
2026-11-26 19:16   ` netdev-bot+sashiko
2026-11-25 19:14 ` [PATCH net-next v2 06/12] amt: size the encapsulation headroom by the outer IP version Omar Ramadan
2026-11-26 19:17   ` netdev-bot+sashiko
2026-11-25 19:14 ` [PATCH net-next v2 07/12] amt: send the AMT gateway control plane over IPv6 Omar Ramadan
2026-11-25 19:14 ` [PATCH net-next v2 08/12] amt: receive " Omar Ramadan
2026-11-26 19:17   ` netdev-bot+sashiko [this message]
2026-11-25 19:14 ` [PATCH net-next v2 09/12] amt: add netlink attributes for an IPv6 outer transport Omar Ramadan
2026-11-25 19:14 ` [PATCH net-next v2 10/12] MAINTAINERS: amt: cover the amt headers and selftests Omar Ramadan
2026-11-25 19:14 ` [PATCH net-next v2 11/12] selftests: net: add amt_v6.sh for an IPv6 outer transport Omar Ramadan
2026-11-26 19:17   ` netdev-bot+sashiko
2026-11-25 19:14 ` [PATCH net-next v2 12/12] selftests: net: add amt_gw_v6.sh for the IPv6 netlink attributes Omar Ramadan
2026-11-26 19:17   ` netdev-bot+sashiko

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=179572062268.3135.2896747109290971474@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 \
    /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