From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=fail (p=reject dis=none) header.from=canonical.com Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by passt.top (Postfix) with ESMTPS id 39C805A0265 for ; Mon, 16 Nov 2026 16:11:48 +0100 (CET) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id A3BA93F71C for ; Mon, 16 Nov 2026 15:11:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20251003; t=1794841907; bh=sOYo+JbtGkWu3yxzRevss0+Obtx/0vjrKNkAK80/zUI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=kWwZoROZmWMMg9qsBWUvIXMWNuVV4DSs8uK5vnhMJw9ZCI0Bmx24mxokHffsDz0mR IVF68xWk9gFwvqRK+30epq8LoFmR8im8B1PYY5FmD2HxlqHmDY+P1a4roNgoZoksLS U7c1bgu4voSiqy7l2a8hyUtCZW3wt12e+7+hlQxTzrQKbOAaiSbHDcpz3rrhB/geGr naqaBsdZpBp8ffZYLWKWl7fggmgy2FQ8WHtrXUAtNBAatFl7s2+KUbsnUiJvrbattk 68vtoBq6A05a0fVKhmI0gGmaQ1JBM5NOYEkP196bE7M1cprxIqQkSz1qmb7ClWV7PY ZZGpbRYeCWBAyyvrlREEX7/Hi0++auxcwG/9R/Gccp+KiQIs0D+KEyAugmkOFpXL6H PK2wxBVy1ebzsIbCP9F12vM702Cn22jxHml/wN5AitkkwQBWGt2RXe8e1S0kUISw+2 Tvrdx+Ph+wz5Z3LhtGwloe2h4RWc/Y5iwAWY/03cUf18rA21VZQoJlFjDjYtJjIuxT gX8jEFYTfzPpZau+EBZTje92rv0ez6CkLyEVa936RQaKtrLSrNUNU6BhU2gdoS8C34 Pt3Oosj3XjEH5B6J3+Kgh720uDI/0ex2RbGMMtt0uM60QFHmaehkAXN6c92a8KpPvR ZG/M27nMEuM/mGMJ8k7lrQyo= Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-6b6f881bcc4so827660a12.0 for ; Mon, 16 Nov 2026 07:11:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794841907; cv=none; d=google.com; s=arc-20260327; b=ptwxR3lzVFLDPirz/2ib+R8hwG4TEY9sb+H9eiRb451//UB7ykwm7hoQoXMiUvDrXX sfqSCX0GEDOSPzrirca5ru8AW8e1T4bwohe4uU/Ic6x+Lqj8wg7HkWv4h6NsUrhljQcX qh0tWngWbdMO6oLXmB2Q5ehfXIV1FgbAJA4B2e53p50YlGYbTqbfKfzek636ZpxwMXMH xqREVJw2QdB4eDahBA9m2rg5oBBZ7mAOwl9cwoaome3cKGcpYjSsZNxxpKxLmskBs5M1 kCdtI6DXY5c0BjanjZNq5+fDKnrmxAY3CkxEatgbPt15Ii7xv/LtZJJdrnc+dSLCyvrl Cmaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version; bh=sOYo+JbtGkWu3yxzRevss0+Obtx/0vjrKNkAK80/zUI=; fh=htis3z6nDPD3FFPmKX7SGQyhLv1B9tDlnJYWrC8d10o=; b=ERRi8YCfmInBrjNasjnt2stF9hico4t/AGfy7J8TRE1DB3CudroEt3QoXtS4JuUSSr duSQXV1Hewp5Xzs9abi3tD19HmIHQqpsFZUTi1uAF29MtxBG9XwoONoEzUrhLLhX5gUK hCiC0sJyiL5d+ine9zkmt6nvDhvG7n+9LFsIyhJ7+ZgpDFCfo0cm6Iq3b5pqKdzqrNot EkczJZ3Zzr6Wr3lazOYUPAWCbyGipOVwuPwOnmUDk6Xe7nSVe6VVf6SStN20YdQYv50x c3g9M0xkjUGhWI5abR0bpJxUs/MAiVizs16h4rrh5RjisSJQIFyeiPkuz8Vd1iw3UlaE KxqA==; darn=passt.top ARC-Authentication-Results: i=1; mx.google.com; arc=none X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794841907; x=1795446707; h=content-type:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=sOYo+JbtGkWu3yxzRevss0+Obtx/0vjrKNkAK80/zUI=; b=susUnUarySZj4Ix9oZ1Fb+Kg9G/eWGDWcdWW1lsryfHYQbGC3JxiAvH88QAo0xJnHc QRxrwz6vC94U3FuBo32Ib/Z0rARK6Q4gMAzyl3Yi1P0wKAzldMkrtsAPx7HKqdjsSLtj GVK7YseFoRkCVmfr0IkG+YTG6zvSeG8kZM4UXJDO7XgdnKtUWJRqQaayzsmbgTwOxow4 9L5HnpLKn+EE6RDPJKuyafGbygi1oAd6m2bT7gB3NoU8bha0FS5runMAT6ajquARoIZI I1FUGMlOVAtW9cmDHYrcjVD5r9Txwzz/4cF91wBICXEAw+5VSyxXHAZ/qdwbHC3cCMqp wsfw== X-Gm-Message-State: APuU4Z8OCXy2cbFJBXVDtJOTIZIOu6LHGKl0OfRsx/S/RHguM2XEVlqY ocxBqyfvu7r/cQYzk7xnrwHti2a1wRdwoKxhZheWWyoQKNCwDOowGu9ym15P2E9YetCWlyPw758 x6nEmf3FFJs0sz61pu3nomZ1Ma4mf0+C05hsZp1eOv6LBSiMYPpYEwCldDSTqGoKRkwtMFGseDp P5vXc/cqVofQKlmFGOkPGGSxXEau5cHmMLOfqV8a5K5Ngc X-Gm-Gg: AYBFou1mbOwV6Ek7DUB/5gpP4P5j/yo1g0nNJzQ5ca7xEuvk0T+0H5bndUUFUOwiSxz 4443txfD9a3JV+qOKpyfGg4gzy8XJhAuYf76KqXdzzv0Ykat1ZRWRI6ENDXq1mBSCJQOv2Df2uF yp3GuO5vtvx5Ta2OlxkHvDbxrrt5c1PocTH+gQjJD841XEGHu16DRNnlrq2vn1Enz9oe+kQjaRE 0rVZy65cW+QcGq2MOV9xXDtikjV6uHmjUxj X-Received: by 2002:aa7:c7d5:0:b0:6b1:a86c:7b with SMTP id 4fb4d7f45d1cf-6b7c0c51138mr6591924a12.36.1794841907067; Mon, 16 Nov 2026 07:11:47 -0800 (PST) X-Received: by 2002:aa7:c7d5:0:b0:6b1:a86c:7b with SMTP id 4fb4d7f45d1cf-6b7c0c51138mr6591897a12.36.1794841906581; Mon, 16 Nov 2026 07:11:46 -0800 (PST) MIME-Version: 1.0 References: <20261113120752.218502-1-hector.cao@canonical.com> <20261114134727.76eb9245@elisabeth> In-Reply-To: <20261114134727.76eb9245@elisabeth> From: Hector Cao Date: Mon, 16 Nov 2026 16:11:34 +0100 X-Gm-Features: AclHuK-FVOLnTAGfloIuV94UaDAlpzat34pRgy6rxH3iRaGfXJVsucqU_ZoS5Go Message-ID: Subject: Re: [PATCH] apparmor: Add attach_disconnected flag to passt profile To: Stefano Brivio Content-Type: multipart/alternative; boundary="0000000000004529b5066066329d" X-MailFrom: hector.cao@canonical.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation Message-ID-Hash: D6SVWH6NCNKE7U6BMGHOXGK2LVJPJ7IX X-Message-ID-Hash: D6SVWH6NCNKE7U6BMGHOXGK2LVJPJ7IX X-Mailman-Approved-At: Mon, 16 Nov 2026 19:33:22 +0100 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: --0000000000004529b5066066329d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Stefano, Thanks for the info and the pointers. I missed that this was already addressed upstream, so I'll definitely look into backporting it into Ubuntu= . If you have any topic you want to address for Ubuntu, feel free to let me know (either via Matrix or direct email). I am maintaining qemu/libvirt for Ubuntu and passt might be a part of my work. Best, Hector On Sat, Nov 14, 2026 at 1:47=E2=80=AFPM Stefano Brivio = wrote: > Hi Hector, > > On Fri, 13 Nov 2026 13:07:52 +0100 > Hector Cao wrote: > > > In isolate_prefork(), passt detaches from the host filesystem: it > > pivot_root()s into an empty tmpfs and lazily unmounts the old root. > > Paths to objects opened before this point, such as the listening UNIX > > domain socket for the hypervisor, can't be resolved from the new > > root any longer, and AppArmor sees them as disconnected paths. > > > > The visible effect is that accept4() on the hypervisor socket fails > > with EACCES once passt is sandboxed, so the guest can't connect, > > and have networking functional. > > > > Set flags=3D(attach_disconnected), so that disconnected paths are > > attached to the root of the namespace and mediated against the > > existing rules, as other sandboxing profiles (e.g. libvirt's) do. > > > > Signed-off-by: Hector Cao > > --- > > contrib/apparmor/usr.bin.passt | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/contrib/apparmor/usr.bin.passt > b/contrib/apparmor/usr.bin.passt > > index da49e37..ccc2ea9 100644 > > --- a/contrib/apparmor/usr.bin.passt > > +++ b/contrib/apparmor/usr.bin.passt > > @@ -15,7 +15,7 @@ abi , > > > > include > > > > -profile passt /usr/bin/passt{,.avx2} { > > +profile passt /usr/bin/passt{,.avx2} flags=3D(attach_disconnected) { > > Thanks for the report and for the patch. Note that I already added > this flag more than a month ago in commit 032f082ffad0 ("apparmor: > Fixes for new user namespace detaching procedure"): > > > https://passt.top/passt/commit/?id=3D032f082ffad094649066fa94822c5a78a246= a766 > > and I see you now created trees on Ubuntu's Launchpad so I guess you > can backport this from the debian/sid tracking branch instead? See: > > > https://git.launchpad.net/ubuntu/+source/passt/commit/contrib/apparmor/us= r.bin.passt?h=3Ddebian/sid&id=3De05c3ae80ca0ae6a7b227ff074893fa74a59961b > > By the way, I added that flag as part of the fix for: > > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D1149683 > > and in general we tend to fix Debian bugs quite promptly: > > https://bugs.debian.org/cgi-bin/pkgreport.cgi?archive=3Dboth;src=3Dpass= t > > but it looks a bit more complicated to get them fixed in Ubuntu: > > https://bugs.launchpad.net/ubuntu/+source/passt > > and I have to say that I was trying to figure out how to make things > smoother a few years ago, but then I couldn't register a Launchpad > account (because my email address was already in the database as > Debian maintainer) and I gave up. Eventually I got the Launchpad > account with some effort but then I didn't have the change to look > into it anymore. > > But now that I looked into your patch I saw: > > > https://git.launchpad.net/~hectorcao/ubuntu/+source/passt/commit/?id=3D66= f3b374796304982db143624bf83e9d6fcec267 > > so I take that as a good sign. :) > > -- > Stefano > > --=20 Hector CAO Software Engineer =E2=80=93 Server Team / Virtualization hector.cao@canonical.com https://launc hpad.net/~hectorcao --0000000000004529b5066066329d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello Stefano,

Thanks for the info and the poi= nters. I missed that this was already addressed upstream, so I'll defin= itely look into backporting it into Ubuntu.
If you have any t= opic you want to address for Ubuntu, feel free to=C2=A0let me know (either = via Matrix or direct email). I am maintaining qemu/libvirt for Ubuntu and p= asst might be a part of my work.

Best,

Hect= or

On Sat, Nov 14, 2026 at 1:47=E2=80=AFPM Stefa= no Brivio <sbrivio@redhat.com&= gt; wrote:
Hi He= ctor,

On Fri, 13 Nov 2026 13:07:52 +0100
Hector Cao <hector.cao@canonical.com> wrote:

> In isolate_prefork(), passt detaches from the host filesystem: it
> pivot_root()s into an empty tmpfs and lazily unmounts the old root. > Paths to objects opened before this point, such as the listening UNIX<= br> > domain socket for the hypervisor, can't be resolved from the new > root any longer, and AppArmor sees them as disconnected paths.
>
> The visible effect is that accept4() on the hypervisor socket fails > with EACCES once passt is sandboxed, so the guest can't connect, > and have networking functional.
>
> Set flags=3D(attach_disconnected), so that disconnected paths are
> attached to the root of the namespace and mediated against the
> existing rules, as other sandboxing profiles (e.g. libvirt's) do.<= br> >
> Signed-off-by: Hector Cao <hector.cao@canonical.com>
> ---
>=C2=A0 contrib/apparmor/usr.bin.passt | 2 +-
>=C2=A0 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/apparmor/usr.bin.passt b/contrib/apparmor/usr.bin= .passt
> index da49e37..ccc2ea9 100644
> --- a/contrib/apparmor/usr.bin.passt
> +++ b/contrib/apparmor/usr.bin.passt
> @@ -15,7 +15,7 @@ abi <abi/4.0>,
>=C2=A0
>=C2=A0 include <tunables/global>
>=C2=A0
> -profile passt /usr/bin/passt{,.avx2} {
> +profile passt /usr/bin/passt{,.avx2} flags=3D(attach_disconnected) {<= br>
Thanks for the report and for the patch.=C2=A0 Note that I already added this flag more than a month ago in commit 032f082ffad0 ("apparmor:
Fixes for new user namespace detaching procedure"):

=C2=A0 https://passt.to= p/passt/commit/?id=3D032f082ffad094649066fa94822c5a78a246a766

and I see you now created trees on Ubuntu's Launchpad so I guess you can backport this from the debian/sid tracking branch instead? See:

=C2=A0 https://git.launchp= ad.net/ubuntu/+source/passt/commit/contrib/apparmor/usr.bin.passt?h=3Ddebia= n/sid&id=3De05c3ae80ca0ae6a7b227ff074893fa74a59961b

By the way, I added that flag as part of the fix for:

=C2=A0 https://bugs.debian.org/cgi-bin/bu= greport.cgi?bug=3D1149683

and in general we tend to fix Debian bugs quite promptly:

=C2=A0 https://bugs.debian.o= rg/cgi-bin/pkgreport.cgi?archive=3Dboth;src=3Dpasst

but it looks a bit more complicated to get them fixed in Ubuntu:

=C2=A0 https://bugs.launchpad.net/ubuntu/+source/pass= t

and I have to say that I was trying to figure out how to make things
smoother a few years ago, but then I couldn't register a Launchpad
account (because my email address was already in the database as
Debian maintainer) and I gave up.=C2=A0 Eventually I got the Launchpad
account with some effort but then I didn't have the change to look
into it anymore.

But now that I looked into your patch I saw:

=C2=A0 https://git.launchpad.net/~hectorcao/ubuntu/+source/passt= /commit/?id=3D66f3b374796304982db143624bf83e9d6fcec267

so I take that as a good sign. :)

--
Stefano



--
Hector CAO
Software Enginee= r =E2=80=93 Server Team / Virtualization
--0000000000004529b5066066329d--