๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26143

Re: [PATCH net-next v6 03/12] amt: key relay tunnels on a union amt_addr endpoint

#26143
From: netdev-bot+sashiko
Date: Thu, 03 Dec 2026 04:33
92 lines
11130 bytes
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] The commit message's reason for the IPv6 per-source tunnel cap is
  wrong, so the trade-off it describes is misjudged.

--

amt: key relay tunnels on a union amt_addr endpoint

This commit changes the relay tunnel key from a __be32 IPv4 address to a
union amt_addr, so that an IPv6 outer source can be stored and compared in
full. It replaces siphash_3u32() for the Update MAC with amt_relay_mac().
It also makes the per-source tunnel cap count an IPv6 /64 instead of a
single address, via amt_same_source().

> diff --git a/drivers/net/amt.c b/drivers/net/amt.c
> index e3c69ebf78f20..bfdce6897f7cd 100644
> --- a/drivers/net/amt.c
> +++ b/drivers/net/amt.c

[ ... ]

> @@ -187,6 +210,19 @@ static bool amt_addr_equal(union amt_addr *a, union amt_addr *b)
>  	return !memcmp(a, b, sizeof(union amt_addr));
>  }
>  
> +#define AMT_SRC_PREFIX6_LEN	8
> +
> +/* One source for the per-source tunnel cap: an IPv4 address or an IPv6
> + * /64, so that one host cannot reach the cap from each of its addresses.
> + */
> +static bool amt_same_source(const struct amt_dev *amt,
> +			    const union amt_addr *a, const union amt_addr *b)
> +{
> +	if (amt_v6(amt))
> +		return !memcmp(&a->ip6, &b->ip6, AMT_SRC_PREFIX6_LEN);
> +	return a->ip4 == b->ip4;
> +}

[Severity: Low]
Is the premise behind this grouping accurate? The commit message says:

  "one host normally owns a /64 and could otherwise hold the cap from
  each of its addresses"

A /64 is usually the size of one link, not one host. SLAAC gives every
host on a LAN an address from the same /64. Many cloud subnets and VPS
providers also put many hosts or customers in one /64.

On an IPv6 relay, all gateways in such a /64 would share a single cap
from amt_max_tunnels_per_src():

	return clamp_t(u32, amt->max_tunnels / 8, 1,
		       AMT_MAX_TUNNELS_PER_SRC);

That cap can never go above 16, whatever max_tunnels is set to.

Once that many tunnels exist in the /64, amt_request_handler() stops
sending the Membership Query:

	if (!have && (full || per_src >= amt_max_tunnels_per_src(amt)))
		return true;

and amt_tunnel_get_or_create() refuses to create a tunnel:

	if (amt->nr_tunnels >= amt->max_tunnels ||
	    per_src >= amt_max_tunnels_per_src(amt)) {

Would every later gateway on that link then get no service? It also
looks like one party in a shared /64 could use up the cap and lock out
its /64 neighbours. That can't happen for IPv4 hosts that have separate
public addresses.

The commit message does say "Gateways in one /64 share the cap", but it
treats this as the unusual case when it is probably the common one.

This patch can't reach the path yet, because amt_v6() is still false. The
behaviour stays the same once the later patch "amt: add netlink
attributes for an IPv6 outer transport" makes amt_v6() reachable.

Could the commit message rationale be corrected, or the /64 grouping be
reconsidered?

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202043200.286260-1-omar%40blockcast.net
Technical Details
Message-ID: <179627239603.3146.14932561535978359931@kernel.org>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376281-linux-kernel-netdev=dewy.ru
References: <20261202043200.286260-4-omar@blockcast.net>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376281-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v6 03/12] amt: key relay tunnels on a union
 amt_addr endpoint
Date: Thu, 03 Dec 2026 04:33:16 +0000
Organization: Usenet Network
Message-ID: <179627239603.3146.14932561535978359931@kernel.org>
References: <20261202043200.286260-4-omar@blockcast.net>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2142674"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:1w3FDvlLcdQdc8nwJY0bK+cy9Lg= sha256:HRzi8wZpFmidiyEtcAdrxAtAkaotzDSTXT+amr76xCk=
	sha1:IskTrzYchlgRGp3U5Qc9zEsN5kA= sha256:Cxa50CdWq3/4m8rwIBwonKxph4NsfoWsz38CqfGoRrI=
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 BBA9E117818; Thu,  3 Dec 2026 07:33:53 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.501
X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31
	tests=[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]
	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 BsCJwOHFo896;
	Thu,  3 Dec 2026 07:33:50 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-376281-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 54107117817; Thu,  3 Dec 2026 07:33:42 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 822C42827F; Thu,  3 Dec 2026 04:33:33 +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=1796272408;
	b=1i9DL7B6RQ2Sm6RKcf1FvbkfiT/tFwleOGrlNW7SJveEjHwQNVsjXjCHZMXZ/H2vrlRB
	 I1Hvps+2NVqDpJkwVJcRwpiBD23sJOnW9RSHnBy8Rp3NLzdUZM3z4c7x0ygolSl4zdGJD
	 jABGnvI6eKkvaRUPJgDWQohbCsS/Tsozj1V0HBuDaQUe3gKrwpzCik5IA0zgvixh5g6MR
	 WInyiKDIBAMt+DpZNIDcNPxhmb3SdDY+kGjqUXRTM7299/uC8hTkoOAvGJ7MUXmfellIN
	 SVYkGahyCv0x71GD2eiIL5SZuAPenp0VDfDyUj/KauX0P276DeG0S1pkLbTb929TGEA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796272408;
	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=lqJ2IISMlUrKLRWJ6F2jDQZnOkjao+w9i/91S1rHNNo=;
	b=TXoKKn9byIjDOSyMx/mwtczMEd+ZAoJ6vXYnn+qJffxZXMhQx9tChC7azMKxMHM+hzes
	 cVWGOQgTN32FRDy1GgytHlZokP0mduyVNZIYNlpOahpwsevTSDGllthJxoNTrRFepAwyR
	 Qit8HrILOnqG9DGtmjPI24Kp75cncO+Rc7kzWfZtC18i9f74eomfJ2wmBx8N0WVLzjyii
	 WaN+BOtquaolnEAIZzwMRGTuUbCaLA2T7gfq+ppS+7ymtTnYqH323vh1O6G8vRKBz0oeL
	 A7xyc5ayXIMbtYi0lNNKsyhBJFvdznMTTvxvon3kFwJsSddGwz1Sj1HNtkA6lDNqXaQ==
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=Hf9pXAyk;
	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 80021606A6B8;
	Thu,  3 Dec 2026 04:33:28 +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=Hf9pXAyk
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=1796272397;
	b=iArSOhVsyr+zxdl7WywvoqksRsYA3p4SsSiU3Tn9StQ2PPbBuuUIAnbcJ1/g9dv2GDSc
	 UOrlsaJBmbkiNubPIOUueMDZ/ZAtTyfozGF2l50aizASL5sHyzPQXF+x4zalybWmWFm8Y
	 E04an7qimHQI2Srbi3/X1fh27LCmTdUmFlR6o3bbSvAzYd4KC7187KYc1es5ONE70LMjA
	 SsdqtkXFE1eD03VDsOGA5vV9thuS0YlStYMXJQdZLx8N4ULeH5Up7onxMKp5VbI7bFIkb
	 yrJcde6Wm1KFASxc1Nn0/mTWGEYxkEKku4cKW8PrfxgC/tRxRCW6rZVshBJCAAUKY8g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796272397;
	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=lqJ2IISMlUrKLRWJ6F2jDQZnOkjao+w9i/91S1rHNNo=;
	b=qxsIHvSW00IjM8nB8Wefl099kYITZ1XbaSKE7v3qpKJ1UY0Eu85IjBDh65fJxWZd95D5
	 YjWR3kWdNZAwf7bKxLQQy/kYun/CSrE9N0McFoS5qptsk6CaFM2rM8BqBU8bznGia3YqV
	 nVraFXyapnd8nIucUfd+wxum1WERsFDEvVEswZGxRhM20E5rWUsp5uNyaFsIfGj6VTDAs
	 4rYvMnwV91mapx7of/JNrCSjbzK52oJOysOQymdaLTySY/tMKbadabTPQuUK4ay8vJnT5
	 BRfwZHmlv1C2zGSReyY5wdSXyrBNXjStafEsU86x0NZwzPoa2JC6jlN4oBXw68QGZPg==
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=Hf9pXAyk;
	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 9E7AC606A332;
	Thu,  3 Dec 2026 04:33:17 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C5721F000C1;
	Thu,  3 Dec 2026 04:33:16 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796272397;
	bh=lqJ2IISMlUrKLRWJ6F2jDQZnOkjao+w9i/91S1rHNNo=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=Hf9pXAyk36rM+yCmnBO/aunn8IG96+Ldt7uYgC/F2ZMEgTa4D4F6bcIGGUOJd+J43
	 VDKPXLZt6RoWtlsjwOhRJiJIdsC474pHUM5JSHyC5mCURjSkGpWKOFXXA1H6Z4A5OF
	 T2TYVfq5snpZltHP+AwTQVncRnwuB2UIJlOoElsnB4UBpBh4XgmMP7UAwSoX8zWAIs
	 AXRrEdLvcQ1oDPAWb+iFvbDLA42YUfmNLCnT/3SjJazWpjLyNvqo6sKN67jkM9i1Yo
	 uc8faF4Uoz8Ky7dfVS97xRS/D89bFYHdEXJyjuF/kXwm+9z2uuYYTCzwL8NXrdH4Ac
	 hSePNU41vHNfw==
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, dsahern@kernel.org,
 idosch@nvidia.com
X-In-Reply-To: <20261202043200.286260-4-omar@blockcast.net>
X-sashiko-severity: Low
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