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=1796010512; b=p9BaoOuBPXznKAjIsijuFobj6gnDqBLCcz0AkW8MlKRO0YSsG5MMiZImNJcCHL48FIkc MwY0YBU3et2vLdadDAprJUyZepzXDQBxJfR4RVey6V/US7/5+NgqoJRays9VMwk9+TFor t9g6qf2C0ZNRDXdJAke0D0nquRocROcS1g3sap1X8EDvTgH1B6q03l4Ag18zI3r5j8xo9 sflG/PxDpuIxZzC8LWKIYo/SY9nrIo25AxYNwlCGHroNQiMiOaQw1CRH+ZbgNOCAiiY0O GtkEyCHPeiQUAHeCFWaczyd1ezHnndSIvZpT8GsWqdZbXnQPLcLAKMwVyS3Cdbqgw1A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796010512; 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=34Fp4qx4ji5y+XfrHFyf+oWgy8IowAkeTf1HOP+pFmU=; b=FoeeubrhPNT9ITbEEK1qoCWHyd1+/T0sEU5NacL2Q4rBY9quuQcoyOBj3AbtzeYgDQ4k ZsOLRfPN0d2nbO92eA1greLcOM86ZT+9+jYcVmfQDQATFf6FMJJ2EN2eb2LiBzMt10imG p1jv5T7jt8oa0eXvkt3cE7LSEUCCDeq0bJlkxYfaR/dbErwBmOVejUxyB3n3+J8XO7zPz hQAA4UcZRGT6F0R4NhMucnbGhsajciPawpR/sXRMuLjEKsRrC+xjyZoiAcL46dpW/BF0n pPiqzH3DaJtVLSHll6095wiUDRLKRrh/DRBgnTf4hR5pMMaD0PpEI0U3Pw6ME/bpLGw== 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=YHMlEzac; 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 30574606A325; Mon, 30 Nov 2026 03:48:31 +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=YHMlEzac Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3A9A1F00924; Mon, 30 Nov 2026 03:48:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796010511; bh=34Fp4qx4ji5y+XfrHFyf+oWgy8IowAkeTf1HOP+pFmU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=YHMlEzac2yNiw/aqyJNv6oFoHx631CD6COXujzkSMuNqQPpat+sUR0SmuFjFg5pWg YlmFgJ6+f81wl0pDE+MDxAVBUGhg/Bh+X4kJ2+20FRl+0LNMYvOknuGY1+G4M3Jh8p io5asFa4LZquvcSoRXFSlXKid3jY7qGAIPcI0uq7XQYaP8r4nTZwUAR7ImJwoa3n3I o5FbP9D8ew6rGSxvW1pUh0GvJsmN0lLd9LLnpwbrMCQR9EZgafltRTtfg/LxmJnk90 JK1nE6eyXRTMeZjIC0GAe8XX92TMXw6vSewH+a3wwjW6peB7lDzHahX3NDEfwYu5Kt dIk34zt2PwrMQ== Subject: Re: [PATCH net-next v4 02/12] amt: send the Relay Advertisement over IPv6 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: Mon, 30 Nov 2026 03:48:30 +0000 Message-ID: <179601051051.3146.13369414407667117379@kernel.org> In-Reply-To: <20261129034652.1853485-3-omar@blockcast.net> References: <20261129034652.1853485-3-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] In the new IPv6 Discovery path of amt_discovery_handler() (drivers/net/amt.c), the only filters are a multicast outer… -- amt: send the Relay Advertisement over IPv6 This patch adds the 24-byte IPv6 form of the Relay Advertisement and a new amt_send_ctrl_v6() helper, which routes through amt_route6() and sends with udp_tunnel6_xmit_skb(). On an IPv6 device, amt_discovery_handler() now answers a Discovery with this form. The reply is sourced from the Discovery's outer destination and sent back to its outer source and UDP source port. > diff --git a/drivers/net/amt.c b/drivers/net/amt.c > index 3f3205d2df3e8..52ccaca08b5ec 100644 > --- a/drivers/net/amt.c > +++ b/drivers/net/amt.c [ ... ] > @@ -3026,6 +3118,29 @@ static bool amt_discovery_handler(struct amt_dev *amt, struct sk_buff *skb) > if (amtd->reserved || amtd->version) > return true; > > + /* The Advertisement takes the form of the outer IP version, and > + * RFC 7450 s5.1.2 sources it from the address the Discovery was > + * sent to, which may be an anycast Relay Discovery Address rather > + * than local_ipv6. > + */ > + if (amt_v6(amt)) { > + struct in6_addr saddr = ipv6_hdr(skb)->saddr; > + struct in6_addr daddr = ipv6_hdr(skb)->daddr; > + > + /* The socket bound to :: also receives a Discovery sent to > + * a group, and a multicast address can never be a source > + * (RFC 4291 s2.7), so such a Discovery is not answered. Nor > + * is one from ::, which has nowhere to be sent. > + */ > + if (ipv6_addr_is_multicast(&daddr) || > + ipv6_addr_any(&saddr)) > + return true; > + > + amt_send_advertisement_v6(amt, amtd->nonce, &daddr, &saddr, > + udph->source); [Severity: Medium] Will a Discovery whose outer IPv6 source is one of the relay's own addresses still be answered here? The only filters are a multicast destination and a :: source. The outer saddr and udph->source then become the destination address and port of the reply. A remote sender that can forge the source address (on the same link, or on a path without BCP38) could send a Discovery to relay_port. It would set the source to local_ipv6 or the link-local address of stream_dev (for example with saddr == daddr), pick a UDP source port P, and choose the nonce. The reply would then take this path: amt_discovery_handler() amt_send_advertisement_v6(amt, nonce, &daddr, &saddr, udph->source) amt_send_ctrl_v6() amt_route6() ip6_dst_lookup_flow() <- local route for a stream_dev address udp_tunnel6_xmit_skb() <- delivered back to the host over lo The host would send itself a 24-byte datagram from :relay_port to :P. The 4-byte nonce in it is chosen by the sender. The datagram arrives with iif=lo, so common rules such as "-i lo -j ACCEPT" (ufw and firewalld defaults) would let it through. It could then reach local UDP services bound to :: or to that address, which the sender cannot reach directly. The IPv6 input path doesn't seem to stop this. It only rejects loopback and multicast sources: net/ipv6/ip6_input.c:ip6_rcv_core() { ... if ((ipv6_addr_loopback(&hdr->saddr) || ipv6_addr_loopback(&hdr->daddr)) && !(dev->flags & IFF_LOOPBACK) && !netif_is_l3_master(dev)) goto err; ... if (ipv6_addr_is_multicast(&hdr->saddr)) goto err; ... } On IPv4, fib_validate_source() treats a local source as martian by default (accept_local=0). That is why the existing amt_send_advertisement() path is not exposed in the same way. amt_discovery_handler() and amt_rcv() still have only these checks at the end of the series. The path becomes reachable once "amt: add netlink attributes for an IPv6 outer transport" allows an IPv6 outer address to be configured. Would it make sense to drop a Discovery whose outer source is a local address, for example with ipv6_chk_addr(amt->net, &saddr, NULL, 0) or a check on the route type? At minimum, could a Discovery with saddr equal to daddr be dropped? > + return false; > + } > + > amt_send_advertisement(amt, amtd->nonce, iph->saddr, udph->source); > > return false; -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261129034652.1853485-1-omar%40blockcast.net