From: Stefano Brivio <sbrivio@redhat.com>
To: passt-dev@passt.top
Cc: Paul Holzinger <pholzing@redhat.com>,
David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 4/5] apparmor: Allow pasta to remount /proc, access entries under its own copy
Date: Thu, 7 Sep 2023 00:35:14 +0200 [thread overview]
Message-ID: <20230906223515.2533706-5-sbrivio@redhat.com> (raw)
In-Reply-To: <20230906223515.2533706-1-sbrivio@redhat.com>
Since commit b0e450aa8500 ("pasta: Detach mount namespace, (re)mount
procfs before spawning command"), we need to explicitly permit mount
of /proc, and access to entries under /proc/PID/net (after remount,
that's what AppArmor sees as path).
Fixes: b0e450aa8500 ("pasta: Detach mount namespace, (re)mount procfs before spawning command")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
---
contrib/apparmor/abstractions/pasta | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/contrib/apparmor/abstractions/pasta b/contrib/apparmor/abstractions/pasta
index 9cba25a..05c5d46 100644
--- a/contrib/apparmor/abstractions/pasta
+++ b/contrib/apparmor/abstractions/pasta
@@ -15,11 +15,18 @@
include <abstractions/passt>
+ mount "" -> "/proc/",
+
@{PROC}/net/tcp r, # procfs_scan_listen(), util.c
@{PROC}/net/tcp6 r,
@{PROC}/net/udp r,
@{PROC}/net/udp6 r,
+ @{PROC}/@{pid}/net/tcp r, # procfs_scan_listen(), util.c
+ @{PROC}/@{pid}/net/tcp6 r,
+ @{PROC}/@{pid}/net/udp r,
+ @{PROC}/@{pid}/net/udp6 r,
+
@{run}/user/@{uid}/netns/* r, # pasta_open_ns(), pasta.c
@{PROC}/[0-9]*/ns/net r, # pasta_wait_for_ns(),
--
@@ -15,11 +15,18 @@
include <abstractions/passt>
+ mount "" -> "/proc/",
+
@{PROC}/net/tcp r, # procfs_scan_listen(), util.c
@{PROC}/net/tcp6 r,
@{PROC}/net/udp r,
@{PROC}/net/udp6 r,
+ @{PROC}/@{pid}/net/tcp r, # procfs_scan_listen(), util.c
+ @{PROC}/@{pid}/net/tcp6 r,
+ @{PROC}/@{pid}/net/udp r,
+ @{PROC}/@{pid}/net/udp6 r,
+
@{run}/user/@{uid}/netns/* r, # pasta_open_ns(), pasta.c
@{PROC}/[0-9]*/ns/net r, # pasta_wait_for_ns(),
--
2.39.2
next prev parent reply other threads:[~2023-09-06 22:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-06 22:35 [PATCH 0/5] Fixes to AppArmor policy, passt/pasta profile split Stefano Brivio
2023-09-06 22:35 ` [PATCH 1/5] apparmor: Use abstractions/nameservice to deal with symlinked resolv.conf Stefano Brivio
2023-09-06 22:35 ` [PATCH 2/5] apparmor: Explicitly pass options we use while remounting root filesystem Stefano Brivio
2023-09-06 22:35 ` [PATCH 3/5] apparmor: Allow read-only access to uid_map Stefano Brivio
2023-09-06 22:35 ` Stefano Brivio [this message]
2023-09-06 22:35 ` [PATCH 5/5] apparmor: Add pasta's own profile Stefano Brivio
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=20230906223515.2533706-5-sbrivio@redhat.com \
--to=sbrivio@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
--cc=pholzing@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).