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 Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202510 header.b=HMedoBe3; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 4E4065A0272 for ; Fri, 21 Nov 2025 06:24:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202510; t=1763702665; bh=wX79MpxwbJ+p1JQeHonj9XRH6g/Pt+KoYG5AbVmVQCU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HMedoBe3gTaiJIVMEMpi3fhImrhKXUnVw/iawWP+oHmoTn6eQjGDaPddnvlpiZT8k t2zI8ZSoMCedIukFlPawy1dlXZExs45JBSiUtuXFtY111ae/XKEZeTgG063mJiywRN eXNhJO+tNpnwLLV58U3hhiq5G8zaM+dkCTkLLucS/F2NDb5kKviOyQYVuL6NxRBiMr 4PvER8IaDeZGeX5OscnpaWPgcWhGU7KxHX7XCvwDdM8a6pVk6dqD4+8T3DHOTQ2mNt 9+BwAq68RshBAISSSj8wI+ie6d8ZVBwcwk57f1HqgM8LdtmPrX3CitHCQ2L3UtFkzE Wtr5PQVb3+Z9Q== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4dCNtx06ntz4wMB; Fri, 21 Nov 2025 16:24:25 +1100 (AEDT) Date: Fri, 21 Nov 2025 16:24:20 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v4 9/9] tcp, udp: Bind outbound listening sockets by interface instead of address Message-ID: References: <20251119052257.3004500-1-david@gibson.dropbear.id.au> <20251119052257.3004500-10-david@gibson.dropbear.id.au> <20251121045601.021b1793@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="/3DtUr51F4z+Ns5r" Content-Disposition: inline In-Reply-To: <20251121045601.021b1793@elisabeth> Message-ID-Hash: K54NL7JGHKF3WO4Q5MXGAWFZAZSFO7ON X-Message-ID-Hash: K54NL7JGHKF3WO4Q5MXGAWFZAZSFO7ON 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 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: --/3DtUr51F4z+Ns5r Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 21, 2025 at 04:56:01AM +0100, Stefano Brivio wrote: > The series looks good to me in general, except that: >=20 > On Wed, 19 Nov 2025 16:22:57 +1100 > David Gibson wrote: >=20 > > Currently, outbound forwards (-T, -U) are handled by sockets bound to t= he > > loopback address. Typically we create two sockets, one for 127.0.0.1 a= nd > > one for ::1. > >=20 > > This has some disadvantages: > > * The guest can't connect via 127.0.0.0/8 addresses other than 127.0.0= =2E1 > > * We can't use dual-stack sockets, we have to have separate sockets for > > IPv4 and IPv6. > >=20 > > The restriction exists for a reason though. If the guest has any > > interfaces other than pasta (e.g. a VPN tunnel) external hosts could re= ach > > the host via the forwards. Especially combined with -T auto / -U auto = this > > would make it very easy to make a mistake with nasty security implicati= ons. > >=20 > > We can achieve this a different way, however. Don't bind to a specific > > address, but _do_ use SO_BINDTODEVICE to restrict the sockets to the "l= o" > > interface. >=20 > ...this means, as I pointed out on: >=20 > https://archives.passt.top/passt-dev/20251022105916.53925523@elisabeth/ >=20 > that we might break functionality for a number of pasta(1) users. >=20 > I don't have a complete version of the SO_BINDTODEVICE fallback I > sketched there, so I can't just add one on top of this series at the > moment, but we need something like that before I can merge this. Yes, I was intending to make that change, but just forgot. I'll fix this patch and resend. Are you intending to merge the rest of the series, or should I respin it? --=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 --/3DtUr51F4z+Ns5r Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmkf94MACgkQzQJF27ox 2Gekqg//UPDppPSH8ennm6guPeilZNQ98ssDJvX9ZxlB5tk1/RVFCseIrHZxpLHO Ht+T7FS40sCwz4mYK5aJyFJLGK/SmOXwdoz6CzGAWSLbCIambTQAdCPO30xB9lEo 3LRSKNFNS3fewQNP7z1VhebzS4rgRopW+RE//MyrjKA5Q9QJZrZ20kAykjjJNevh +4HwhGCqNdLrxBmxIVs/YF6urwF9FcjP/FXh1rDy+NVf6uBl1xqnl0ymONNaLWvs 8iZF6tTX63RcZbDC+A2bYCp12WrQAVYzUez2zh3smQbYhdcEvLQOfL/ODFuBLjrb /xQxpnHFmgZpJSspunVatW5CpKbYbpyJz7+yEAbaDWrU9nKeVk4ELoQ9977CYpgV A+TJqOnyKLyxtvFZq/avIhUkhc0hgByBQ2Y1VFfdCs9Qr8j6ll5KKaQ49In8xLaW IAhjnh2EtTqI+QhETY+/yqCP8XQomGATy69F9lqyiTpW8QrjJyvGfiN+0V2SPI/G hNYQtRDYV9mmNY2/ARzDqfSHWNjaSQEwJto7dxJqzpNs+I4okAQF62eduxurxwNj H0SvLs8wG7WFw1aVWJu2qhVxSU6PcDFf7c85eNLReMaox1BM+QkcEWi80en7BDdj Cvh66t+BtqZS5xDZ2C/FugSK7sRzeKEdCL+KusC+kXYGBgCvjn8= =rYfs -----END PGP SIGNATURE----- --/3DtUr51F4z+Ns5r--