aboutgitcodebugslistschat
path: root/contrib/apparmor/usr.bin.passt
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/apparmor/usr.bin.passt')
-rw-r--r--contrib/apparmor/usr.bin.passt30
1 files changed, 27 insertions, 3 deletions
diff --git a/contrib/apparmor/usr.bin.passt b/contrib/apparmor/usr.bin.passt
index 564f82f..62a4514 100644
--- a/contrib/apparmor/usr.bin.passt
+++ b/contrib/apparmor/usr.bin.passt
@@ -19,9 +19,33 @@ profile passt /usr/bin/passt{,.avx2} {
include <abstractions/passt>
# Alternatively: include <abstractions/user-tmp>
- owner /tmp/** w, # tap_sock_unix_init(), pcap(),
- # write_pidfile(),
+ owner /tmp/** w, # tap_sock_unix_open(),
+ # tap_sock_unix_init(), pcap(),
+ # pidfile_open(),
+ # pidfile_write(),
# logfile_init()
- owner @{HOME}/** w, # pcap(), write_pidfile()
+ owner @{HOME}/** w, # pcap(), pidfile_open(),
+ # pidfile_write()
+
+ # Workaround: libvirt's profile comes with a passt subprofile which includes,
+ # in turn, <abstractions/passt>, and adds libvirt-specific rules on top, to
+ # allow passt (when started by libvirtd) to write socket and PID files in the
+ # location requested by libvirtd itself, and to execute passt itself.
+ #
+ # However, when libvirt runs as unprivileged user, the mechanism based on
+ # virt-aa-helper, designed to build per-VM profiles as guests are started,
+ # doesn't work. The helper needs to create and load profiles on the fly, which
+ # can't be done by unprivileged users, of course.
+ #
+ # As a result, libvirtd runs unconfined if guests are started by unprivileged
+ # users, starting passt unconfined as well, which means that passt runs under
+ # its own stand-alone profile (this one), which implies in turn that execve()
+ # of /usr/bin/passt is not allowed, and socket and PID files can't be written.
+ #
+ # Duplicate libvirt-specific rules here as long as this is not solved in
+ # libvirt's profile itself.
+ /usr/bin/passt r,
+ owner @{run}/user/[0-9]*/libvirt/qemu/run/passt/* rw,
+ owner @{run}/libvirt/qemu/passt/* rw,
}