[libvirt] [PATCH 1/2] security: aa-helper: allow virt-aa-helper to read /dev/dri

Christian Ehrhardt posted 2 patches 6 years, 12 months ago
There is a newer version of this series
[libvirt] [PATCH 1/2] security: aa-helper: allow virt-aa-helper to read /dev/dri
Posted by Christian Ehrhardt 6 years, 12 months ago
Change fb01e1a44 "virt-aa-helper: generate rules for gl enabled
graphics devices" implemented the detection for gl enabled
devices in virt-aa-helper. But it will in certain cases e.g. if
no rendernode was explicitly specified need to read /dev/dri
which it currently isn't allowed.

Add a rule to the apparmor profile of virt-aa-helper itself to
be able to do that.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
 src/security/apparmor/usr.lib.libvirt.virt-aa-helper | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/security/apparmor/usr.lib.libvirt.virt-aa-helper b/src/security/apparmor/usr.lib.libvirt.virt-aa-helper
index de9436872c..78994bcda6 100644
--- a/src/security/apparmor/usr.lib.libvirt.virt-aa-helper
+++ b/src/security/apparmor/usr.lib.libvirt.virt-aa-helper
@@ -19,6 +19,9 @@ profile virt-aa-helper /usr/{lib,lib64}/libvirt/virt-aa-helper {
 
   /etc/libnl-3/classid r,
 
+  # for gl enabled graphics
+  /dev/dri/{,*} r,
+
   # for hostdev
   /sys/devices/ r,
   /sys/devices/** r,
-- 
2.17.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/2] security: aa-helper: allow virt-aa-helper to read /dev/dri
Posted by Jamie Strandboge 6 years, 11 months ago
On Tue, 12 Feb 2019, Christian Ehrhardt wrote:

> Change fb01e1a44 "virt-aa-helper: generate rules for gl enabled
> graphics devices" implemented the detection for gl enabled
> devices in virt-aa-helper. But it will in certain cases e.g. if
> no rendernode was explicitly specified need to read /dev/dri
> which it currently isn't allowed.
> 
> Add a rule to the apparmor profile of virt-aa-helper itself to
> be able to do that.
> 
> Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> ---
>  src/security/apparmor/usr.lib.libvirt.virt-aa-helper | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/security/apparmor/usr.lib.libvirt.virt-aa-helper b/src/security/apparmor/usr.lib.libvirt.virt-aa-helper
> index de9436872c..78994bcda6 100644
> --- a/src/security/apparmor/usr.lib.libvirt.virt-aa-helper
> +++ b/src/security/apparmor/usr.lib.libvirt.virt-aa-helper
> @@ -19,6 +19,9 @@ profile virt-aa-helper /usr/{lib,lib64}/libvirt/virt-aa-helper {
>  
>    /etc/libnl-3/classid r,
>  
> +  # for gl enabled graphics
> +  /dev/dri/{,*} r,
> +

This looks fine.

-- 
Jamie Strandboge             | http://www.canonical.com
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list