public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: passt-dev@passt.top, Anders Ingemann <anders@ingemann.de>
Subject: Re: [PATCH 3/3] tap: Drop IPv6 packets with outbound v4-mapped addresses as well
Date: Tue, 24 Nov 2026 13:59:32 +1100	[thread overview]
Message-ID: <awT9k3jj8PQa0-hC@gractus.seuss> (raw)
In-Reply-To: <20261124024012.547787-4-sbrivio@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 3376 bytes --]

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:
> 
>   https://datatracker.ietf.org/doc/html/draft-itojun-v6ops-v4mapped-harmful-02
> 
> 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".
> 
> 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.
> 
> Reported-by: Anders Ingemann <anders@ingemann.de>
> Suggested-by: David Gibson <david@gibson.dropbear.id.au>
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
> ---
>  passt.1 | 16 ++++++++++++++++
>  tap.c   |  3 ++-
>  2 files changed, 18 insertions(+), 1 deletion(-)
> 
> 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 well.  The latter
>  behaviour used to be the default, but is usually undesirable, since it
>  can unintentionally expose namespace local services to the host.
>  
> +.SS Handling of IPv6 packets with IPv4-mapped addresses
> +
> +\fBpasst\fR and \fBpasta\fR implement some of the recommendations from the
> +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 reached 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 1023)
>  
>  If the port forwarding configuration requires binding to ports with numbers
> 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;
>  
>  	if (af == 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;
>  
>  	debug_ratelimit(now, "Invalid address on tap interface: %s -> %s",
> -- 
> 2.43.0
> 

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2026-11-24  3:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24  2:40 [PATCH 0/3] Throttle messages for invalid addresses, drop v4-mapped packets Stefano Brivio
2026-11-24  2:40 ` [PATCH 1/3] tap: Move tap4_handler() / tap6_handler() adddress checks to own function Stefano Brivio
2026-11-24  2:40 ` [PATCH 2/3] tap: Rate limit messages about filtered guest-side addresses Stefano Brivio
2026-11-24  2:40 ` [PATCH 3/3] tap: Drop IPv6 packets with outbound v4-mapped addresses as well Stefano Brivio
2026-11-24  2:59   ` David Gibson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=awT9k3jj8PQa0-hC@gractus.seuss \
    --to=david@gibson.dropbear.id.au \
    --cc=anders@ingemann.de \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).