]> xenbits.xensource.com Git - libvirt.git/commitdiff
apparmor: allow openGraphicsFD for virt manager >1.4
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>
Mon, 13 Aug 2018 13:58:06 +0000 (15:58 +0200)
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>
Thu, 16 Aug 2018 10:58:56 +0000 (12:58 +0200)
virt-manager's UI connection will need socket access for openGraphicsFD
to work - otherwise users will face a failed connection error when
opening the UI view.

Depending on the exact versions of libvirt and qemu involved this needs
either a rule from qemu to libvirt or vice versa.

Acked-by: Jamie Strandboge <jamie@canonical.com>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
examples/apparmor/libvirt-qemu
examples/apparmor/usr.sbin.libvirtd

index df5f5124871761cab29988c987e6ccedcb5ef038..5caf14e418aeddecf65da3c6f451974a4c05c1f0 100644 (file)
   @{PROC}/device-tree/** r,
   /sys/firmware/devicetree/** r,
 
+  # allow connect with openGraphicsFD to work
+  unix (send, receive) type=stream addr=none peer=(label=/usr/sbin/libvirtd),
+
   # for gathering information about available host resources
   /sys/devices/system/cpu/ r,
   /sys/devices/system/node/ r,
index 3102cab382670302982e671e33a92faefb14821c..dd37866c2a4f47aaf3e2e3bbb2eb7c3777640d16 100644 (file)
   unix (send, receive) type=stream addr=none peer=(label=/usr/sbin/libvirtd//qemu_bridge_helper),
   signal (send) set=("term") peer=/usr/sbin/libvirtd//qemu_bridge_helper,
 
+  # allow connect with openGraphicsFD, direction reversed in newer versions
+  unix (send, receive) type=stream addr=none peer=(label=libvirt-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*),
+  # unconfined also required if guests run without security module
+  unix (send, receive) type=stream addr=none peer=(label=unconfined),
+
   # Very lenient profile for libvirtd since we want to first focus on confining
   # the guests. Guests will have a very restricted profile.
   / r,