From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 6A0855A0269 for ; Tue, 24 Nov 2026 04:02:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202610; t=1795489351; bh=G1rduIj1djk7nBIjzf4CYvy+1h5fuTZEdpWnBB3GJLQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BkPW5e49v8NdB9CQOaS9//JUooMyhTKGA36fgqWiHvv0S8qZZ0kT8sqF3S0JZ+cqW Zx13hHJDWKiU0EMlkkGAFwlssWHC0w0sB2DgIKbqEkSIbqx9dqm/AZ0p+muvV9LnHA Z97n9ppdioE4wsQPsvK+u+t1N0rBEvdFf8p96WMpN4qEvnUeSkWxfXSAoCgsWzJpGm fkHi9sHjXIJnVRf1iJsF/hw375UxAfnJgw4gvkn9McZ92QB8dpc1ooyTpP7OYzOq0v SpWJru7fMr2Ghf/BrcrgdHdIohmbgO+auxdLsDxiWJZ5UDYD3f/w5b6t17tNfO/mrl Qe4EOxs/+BczQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4jYSKM25Jbz4wMH; Tue, 24 Nov 2026 14:02:31 +1100 (AEDT) Date: Tue, 24 Nov 2026 13:59:32 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 3/3] tap: Drop IPv6 packets with outbound v4-mapped addresses as well Message-ID: References: <20261124024012.547787-1-sbrivio@redhat.com> <20261124024012.547787-4-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2gt0Y4B4i8SRPhf6" Content-Disposition: inline In-Reply-To: <20261124024012.547787-4-sbrivio@redhat.com> Message-ID-Hash: MP5IDKBUJNFGI2GEOMWURO3ED4N5LV75 X-Message-ID-Hash: MP5IDKBUJNFGI2GEOMWURO3ED4N5LV75 X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, Anders Ingemann X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --2gt0Y4B4i8SRPhf6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 24, 2026 at 03:40:12AM +0100, Stefano Brivio wrote: > ...not just ones with loopback addresses. It was a convenient way to > try out stuff, but I don't think anybody is using this (also judging > from the current KubeVirt integration), while Anders reported it as > unexpected, and David points out that even though this never became an > RFC: >=20 > https://datatracker.ietf.org/doc/html/draft-itojun-v6ops-v4mapped-harmf= ul-02 >=20 > it's actually mentioned by RFC 4038 as a draft presenting legitimate > concerns. In the context of this draft, it's not obvious whether we > are a router, or a node, but, arguably, we implement at least some > notion of "wire". >=20 > So, while we don't really have any formal requirement to drop those, > err on the side of caution and filter them out just like we do with > packets with loopback addresses. Document it as well, just in case > somebody else used that trick. >=20 > Reported-by: Anders Ingemann > Suggested-by: David Gibson > Signed-off-by: Stefano Brivio > --- > passt.1 | 16 ++++++++++++++++ > tap.c | 3 ++- > 2 files changed, 18 insertions(+), 1 deletion(-) >=20 > diff --git a/passt.1 b/passt.1 > index 5d236bd..daceba1 100644 > --- a/passt.1 > +++ b/passt.1 > @@ -1126,6 +1126,22 @@ appear to come from loopback in the namespace as w= ell. The latter > behaviour used to be the default, but is usually undesirable, since it > can unintentionally expose namespace local services to the host. > =20 > +.SS Handling of IPv6 packets with IPv4-mapped addresses > + > +\fBpasst\fR and \fBpasta\fR implement some of the recommendations from t= he > +expired draft-itojun-v6ops-v4mapped-harmful-02 Internet-Draft: > + > +.nf > + https://datatracker.ietf.org/doc/draft-itojun-v6ops-v4mapped-harmful/02/ > +.fi > + > +by silently discarding outbound IPv6 packets with IPv4-mapped addresses = used as > +source or destination. This means that IPv4 destinations can't be reach= ed from > +the guest or container via IPv6 using their IPv4-mapped representation. Fwiw, I don't think that was _ever_ an intended use for IPv4-mapped addresses (:ffff::/96). Rather that was the purpose of (deprecated) IPv4-compatible IPv6 addresses (::/96). > +If you have any use for traffic forwarding using IPv4-mapped addresses, = refer to > +\fBREPORTING BUGS\fR below. > + > .SS Binding to low numbered ports (well-known or system ports, up to 102= 3) > =20 > If the port forwarding configuration requires binding to ports with numb= ers > diff --git a/tap.c b/tap.c > index eb2f147..13b31b1 100644 > --- a/tap.c > +++ b/tap.c > @@ -684,7 +684,8 @@ static bool tap_filter_address(const struct timespec = *now, sa_family_t af, > return false; > =20 > if (af =3D=3D AF_INET6 && > - !IN6_IS_ADDR_LOOPBACK(saddr) && !IN6_IS_ADDR_LOOPBACK(daddr)) > + !IN6_IS_ADDR_LOOPBACK(saddr) && !IN6_IS_ADDR_LOOPBACK(daddr) && > + !IN6_IS_ADDR_V4MAPPED(saddr) && !IN6_IS_ADDR_V4MAPPED(daddr)) > return false; > =20 > debug_ratelimit(now, "Invalid address on tap interface: %s -> %s", > --=20 > 2.43.0 >=20 --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --2gt0Y4B4i8SRPhf6 Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmsE/ZQACgkQzQJF27ox 2Gd2qRAArCqWKrQZ8L2mHBVyHhSdlwGUAT9ziNWpAJ6R0rZtZo/86zfSmJgMfcp2 bAGECWYPMiFjCrgjHBna4DJJYbDxkQ+bT14BLr2GZPOl3VLCjd6e/OJ05RdZ21No vWCw4w0nguvNkEA9Uxvkg02oqa5E5Gd8WwXVJPORSrTts814gHiLGfsf79bHh0hd TeOajW46as2nwEIcXb0U5+u7/juOqG0HQzJWstih69BrWJmwwaZ2jukrnS96rQd7 5FnBpeSzfo5J9FkSeE5dqN79x/1LmIo+0CG1cFVPTIglkHy4QWIs6S8rGMtusTZo +iW5WHK9ygxCF2C/YDBAWW3Zfd+0XL+MaGav+5ekxgtJwJuco/hp1QXMr18Rsf4Q rxM1aPKgMl2YaNtETHdBFCz1rBs1+yOZUVODQuJayRT/DAIr77tszO6XIA7Y2g1L gMEFsKzOGD21oK1bxHlP7VIHWLexByblWfdhGiZuUcnCdSgpfkhxSSNCPscXq+PY jqGy30m1wUo5uCiDtNi+oY75B4K3KY/ZwJXFGMP8cNdWlQvVoFI11z+s5o4OZBlI L24T1+mr/0WT9zcH4ykJcwaH7/zXPKRj2gD+HbAfvAH0ktmhE0RIPhALFDsIx5el vJOfoTtwSDlJSvMOvhHN3jIdvzhF3HEEgshG+UiTiR9SJlKty8E= =n1PT -----END PGP SIGNATURE----- --2gt0Y4B4i8SRPhf6--