๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25017

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

#25017
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 06:46
98 lines
11783 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 0

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] For an IPv6 relay, the per-source tunnel cap treats each /64
  as one source.

--

amt: key relay tunnels on a union amt_addr endpoint

This commit stores the relay's tunnel endpoint as a union amt_addr
instead of a __be32, so the field can hold an IPv6 outer source. It
switches the Membership Update MAC to a single siphash() over the packed
{address, port, nonce} tuple. It also makes the per-source tunnel cap
treat an IPv6 /64 as one source.

> diff --git a/drivers/net/amt.c b/drivers/net/amt.c
> index 52ccaca08b5ec..386dec11acc62 100644
> --- a/drivers/net/amt.c
> +++ b/drivers/net/amt.c

[ ... ]

> @@ -189,6 +215,23 @@ static bool amt_addr_equal(union amt_addr *a, union amt_addr *b)
>  	return !memcmp(a, b, sizeof(union amt_addr));
>  }
>  
> +/* Bytes of an IPv6 source that make up its /64. */
> +#define AMT_SRC_PREFIX6_LEN	8
> +
> +/* Whether @a and @b are one source for the per-source tunnel cap. An IPv6
> + * host normally owns a whole /64, so counting per address would let it
> + * reach the cap from each of its addresses and fill the table; the cap
> + * therefore counts per /64. For IPv4 a source is an address. Tunnels
> + * themselves are still found by their full endpoint.
> + */
> +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: Medium]
With the cap counted per /64, can a single IPv6 subscriber still fill the
relay's tunnel table?

The commit message says a per-address count "would let it open the cap's
worth of tunnels from each of its addresses and keep the table full".
The same reasoning seems to apply one level up. End sites are usually
delegated a /56 or /48, and residential DHCPv6-PD often hands out a /56
or /60. That gives one party between 16 and 65536 distinct /64 sources.

amt_max_tunnels_per_src() is:

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

With the default AMT_MAX_TUNNELS of 128 this is 16, so eight /64s are
enough to reach max_tunnels. To get a valid MAC for an endpoint, the
attacker only has to receive the Membership Query at that address. Anyone
who holds a routed prefix can do that:

amt_request_handler()           per_src counted only within one /64,
                                Query sent with MAC
amt_update_handler()            amt_relay_mac() verified
  -> amt_update_tunnel()
    -> amt_tunnel_get_or_create()   tunnel created

When the table is full, amt_request_handler() withholds the Query, and
amt_tunnel_get_or_create() returns NULL for new legitimate gateways. On
IPv4 the same attack needs eight separate public addresses.

This path can't be reached at this commit because amt_v6() is always
false. It becomes reachable once IFLA_AMT_LOCAL_IP6 is added in "amt:
add netlink attributes for an IPv6 outer transport", and the per-/64
policy is still the same there.

The commit message covers the cost in the other direction: gateways that
share a /64, including all of fe80::/64, share one cap of at most 16. It
doesn't mention this case.

Would a shorter prefix, or an extra cap at a shorter prefix, fit the
stated rationale better? If not, could the commit message at least
describe this limitation?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130064249.1874523-1-omar%40blockcast.net
Technical Details
Message-ID: <179610757853.3146.12008456241680136082@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374756-linux-kernel-netdev=dewy.ru
References: <20261130064249.1874523-4-omar@blockcast.net>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374756-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v5 03/12] amt: key relay tunnels on a union
 amt_addr endpoint
Date: Tue, 01 Dec 2026 06:46:18 +0000
Organization: Usenet Network
Message-ID: <179610757853.3146.12008456241680136082@kernel.org>
References: <20261130064249.1874523-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="1639827"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Jx9QEAcEvmX3Jf8JB/lvtD05Gn0= sha256:82owA5zjU8HYRFdvN8PZ/Xuhucs5J2+l/lv9/j/zr0Q=
	sha1:QRcQNxzu+MEZ6JtjBjd1OWviqJs= sha256:hBWvMZ0O1RwKnu/jASLAI5N9Q10qmHDqpes/mS+jz/A=
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 4BEDC117276; Tue,  1 Dec 2026 09:47:26 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, 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, URIBL_BLOCKED=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 JXrH4M3fgGDb;
	Tue,  1 Dec 2026 09:47:23 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374756-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id C4D7C117277; Tue,  1 Dec 2026 09:47:14 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 63A752F9F7; Tue,  1 Dec 2026 06:46:36 +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=1796107586;
	b=Yn5pDzTmatMyc9KMQMdsTiCxWHosLwksyZLJyIZbfkz3iSdbQc2T5BA3zi5t5j9gj9R9
	 rWFB8roE2kwJSmbFx/3YMMeimumzn7nG1LtlTc63F2eidw8oh4Fm1515mc6mPh0Lr1rhm
	 JdmOGmirzyc6+LFrXCsi7jYglbqF4/Uqf8tV2N/L/G/H9EV4N1KP96iYu2Cl5LIPdQ64S
	 ZvPqorOwK0p6TaUvkQ402XthhCYsC8N3BxRaKZryCFpKmH7tQodceKkIXecAMSYnPRjxr
	 1hOMHPGzV+r3OMYyP7qDoosfbeoiN7Ty0d5yb6MRDTVGuDUiSJCla46ob+uqlha9cMA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796107586;
	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=2ZqclDmUNgDYASPobCxVeiApBbauiQgW3TVATkPGydQ=;
	b=3yZKXtPDZLG+ZiJ+kKTWsp3UOTa5PntSmsmY6rz8RDMGxWSNR+AA/2hpUW+fGktF3J7A
	 jwWLGLPqLj04klPuNNs+mGyOpLZzE/zbFAuoHIZcbXCsflvuitQzak3pKFpg4TkIOTHcT
	 RQEuFtDfyCZ7YFt7wzFR3MtSHZ8mtXPms3B5J65IIxeJld8k8O91vadEOWvI3gygzg1PF
	 cR5bp4wqAUij+h2HT4PNMmI/uNEYO27G2865h/EJcOSy8qIAQjHC4BSy8DorOqVYSf7jQ
	 puZyIV22m2z2ZT7AWksyCEDBXyLBBG5eW9ueLTT4wR6dkz0lq1UMLKVT6d7ybMPPk6A==
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=PLnsYSFX;
	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 7B9F6606A6B1;
	Tue,  1 Dec 2026 06:46:26 +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=PLnsYSFX
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=1796107580;
	b=F/LjpFMElGwLWKhFxZ/yPC2hJKX05G4ealBCJFoQ7sNB918t/oM7sxrtlrG1hY3pk93q
	 BZAPlF77ngbND/ziUwpJYzWUT06WrfHdEC1tJHPWX5Ic6plIk/JWy6NOgptuPNtsbABxS
	 JVqPnXsbtitCpSyz0vxXGlWMv9GLs58G2B0S712xRB0lOE5mYde7LXgX0DA+ylLCTaF9E
	 L2xb2ORP/KfhnbsGU3bhwP0A93wrrH+mW3M/yEKIBCdepISOYKC6ceIHuzFHFA18s5XxQ
	 mu2HNuI+pUIgI7U9/fVNl72dfwK26tUEbxk9F/9XnIZqvNvyehGpgkQY0xDprH+xD1A==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796107580;
	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=2ZqclDmUNgDYASPobCxVeiApBbauiQgW3TVATkPGydQ=;
	b=qMpw7Xo0IONlnPfQ3w8gIgYcMgIHd69h04hz0Y8WN9XqgzqQvxJSgESFqhWZ9Gipsq63
	 knjke3p6OfxCIq6sHsIfU4M0kNLzT1/a6hs7GHPJ5sfaig4DLIFzs/OqfjhBwrizV9oHu
	 eVg/ltDyF+Ypd01eEzmDOP6KMrDFuxDbkOaLIF7D6YWIAEUfK8RAiBGp4Oz4nvqft84j9
	 7PL2A90PjJUmaAFWlKzadhE2FvmfmDg35nCSsOoUqAee0OOTul5khxDTYepISO89ax4W0
	 b/BqW8fGW9d7i7UaCbwlvjXOjgZpYFEJzibs36TfHDMX5Vu/iqZ22aQvaOyoFEJ9FYA==
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=PLnsYSFX;
	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 9C5EB606A33F;
	Tue,  1 Dec 2026 06:46:19 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 051FD1F00934;
	Tue,  1 Dec 2026 06:46:18 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796107579;
	bh=2ZqclDmUNgDYASPobCxVeiApBbauiQgW3TVATkPGydQ=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=PLnsYSFX0kMloXRX8kRzpfh9sM/9GYUzE1oozGCX8OCup0ymcBjeDkKLG0Mrov6XN
	 8yacVqsnnZ+mOzbbP8ZZwaYLhgCLLSRv6+F8XEHMRfZFCy9Hl0wfjapDX9BKThos+X
	 mXD9Jq1nLMhSqxvoCaVfOEom5Eu9LDzb5zoT6GE/Xng9Pd9LyB70i/kGZkyPRrAVpw
	 XOFfGSK5yJ9Xt8dmEDS6zT2oRKuVlHpSdSaV5M8O/MH1gFxfWnC/myKDxsdflqEjby
	 SVrsdzMOFsPjnHFj7vdwkC/bZ5EzD5yoWHBpSpZaATKWw7n9ebnzObweD30AH7Ohar
	 CO5vj5uVHd2PQ==
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
X-In-Reply-To: <20261130064249.1874523-4-omar@blockcast.net>
X-sashiko-severity: Medium
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