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=1796107580; b=F/LjpFMElGwLWKhFxZ/yPC2hJKX05G4ealBCJFoQ7sNB918t/oM7sxrtlrG1hY3pk93q BZAPlF77ngbND/ziUwpJYzWUT06WrfHdEC1tJHPWX5Ic6plIk/JWy6NOgptuPNtsbABxS JVqPnXsbtitCpSyz0vxXGlWMv9GLs58G2B0S712xRB0lOE5mYde7LXgX0DA+ylLCTaF9E L2xb2ORP/KfhnbsGU3bhwP0A93wrrH+mW3M/yEKIBCdepISOYKC6ceIHuzFHFA18s5XxQ mu2HNuI+pUIgI7U9/fVNl72dfwK26tUEbxk9F/9XnIZqvNvyehGpgkQY0xDprH+xD1A== 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== 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 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) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 051FD1F00934; Tue, 1 Dec 2026 06:46:18 +0000 (UTC) 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== Subject: Re: [PATCH net-next v5 03/12] amt: key relay tunnels on a union amt_addr endpoint 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 Date: Tue, 01 Dec 2026 06:46:18 +0000 Message-ID: <179610757853.3146.12008456241680136082@kernel.org> In-Reply-To: <20261130064249.1874523-4-omar@blockcast.net> References: <20261130064249.1874523-4-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 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