public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Hector Cao <hector.cao@canonical.com>
To: passt-dev@passt.top
Subject: [PATCH] apparmor: Add attach_disconnected flag to passt profile
Date: Fri, 13 Nov 2026 13:07:52 +0100	[thread overview]
Message-ID: <20261113120752.218502-1-hector.cao@canonical.com> (raw)

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=(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 <hector.cao@canonical.com>
---
 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 <abi/4.0>,
 
 include <tunables/global>
 
-profile passt /usr/bin/passt{,.avx2} {
+profile passt /usr/bin/passt{,.avx2} flags=(attach_disconnected) {
   include <abstractions/passt>
 
   include <abstractions/user-tmp>		# tap_sock_unix_open(),
-- 
2.53.0


                 reply	other threads:[~2026-11-13 12:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261113120752.218502-1-hector.cao@canonical.com \
    --to=hector.cao@canonical.com \
    --cc=passt-dev@passt.top \
    /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).