From: Stefano Brivio <sbrivio@redhat.com>
To: passt-dev@passt.top
Cc: "Jörg Sonnenberger" <joerg@bec.de>,
"Danish Prakash" <danish.prakash@suse.com>,
"Christian Boltz" <suse-beta@cboltz.de>,
"Paul Holzinger" <pholzing@redhat.com>
Subject: [PATCH 2/3] apparmor: Expand scope of @{run}/user access, allow writing PID files too
Date: Wed, 3 Apr 2024 21:04:20 +0200 [thread overview]
Message-ID: <20240403190425.2848764-3-sbrivio@redhat.com> (raw)
In-Reply-To: <20240403190425.2848764-1-sbrivio@redhat.com>
With Podman's custom networks, pasta will typically need to open the
target network namespace at /run/user/<UID>/containers/networks:
grant access to anything under /run/user/<UID> instead of limiting it
to some subpath.
Note that in this case, Podman will need pasta to write out a PID
file, so we need write access, for similar locations, too.
Reported-by: Jörg Sonnenberger <joerg@bec.de>
Link: https://github.com/containers/buildah/issues/5440
Link: https://bugzilla.suse.com/show_bug.cgi?id=1221840
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
---
contrib/apparmor/abstractions/pasta | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/apparmor/abstractions/pasta b/contrib/apparmor/abstractions/pasta
index a890391..060caab 100644
--- a/contrib/apparmor/abstractions/pasta
+++ b/contrib/apparmor/abstractions/pasta
@@ -27,7 +27,7 @@
@{PROC}/@{pid}/net/udp r,
@{PROC}/@{pid}/net/udp6 r,
- @{run}/user/@{uid}/netns/* r, # pasta_open_ns(), pasta.c
+ @{run}/user/@{uid}/** rw, # pasta_open_ns(), main()
@{PROC}/[0-9]*/ns/net r, # pasta_wait_for_ns(),
@{PROC}/[0-9]*/ns/user r, # conf_pasta_ns()
--
@@ -27,7 +27,7 @@
@{PROC}/@{pid}/net/udp r,
@{PROC}/@{pid}/net/udp6 r,
- @{run}/user/@{uid}/netns/* r, # pasta_open_ns(), pasta.c
+ @{run}/user/@{uid}/** rw, # pasta_open_ns(), main()
@{PROC}/[0-9]*/ns/net r, # pasta_wait_for_ns(),
@{PROC}/[0-9]*/ns/user r, # conf_pasta_ns()
--
2.43.0
next prev parent reply other threads:[~2024-04-03 19:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-03 19:04 [PATCH 0/3] Assorted AppArmor policy fixes for passt and pasta Stefano Brivio
2024-04-03 19:04 ` [PATCH 1/3] apparmor: Add mount rule with explicit, empty source in passt abstraction Stefano Brivio
2024-04-03 19:04 ` Stefano Brivio [this message]
2024-04-03 19:04 ` [PATCH 3/3] apparmor: Fix access to procfs namespace entries in pasta's abstraction 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=20240403190425.2848764-3-sbrivio@redhat.com \
--to=sbrivio@redhat.com \
--cc=danish.prakash@suse.com \
--cc=joerg@bec.de \
--cc=passt-dev@passt.top \
--cc=pholzing@redhat.com \
--cc=suse-beta@cboltz.de \
/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).