]> xenbits.xensource.com Git - libvirt.git/commit
cgroup: allow fine-tuning of device ACL permissions
authorEric Blake <eblake@redhat.com>
Wed, 9 Mar 2011 03:13:18 +0000 (20:13 -0700)
committerEric Blake <eblake@redhat.com>
Wed, 9 Mar 2011 18:35:36 +0000 (11:35 -0700)
commit5564c575285df117ec9159a6403847699c9cffb0
tree10f948d60c84c98ec292de60f4c5da9fba483839
parent48096a0064df4ed584407cb9536a991df2738f65
cgroup: allow fine-tuning of device ACL permissions

Adding audit points showed that we were granting too much privilege
to qemu; it should not need any mknod rights to recreate any
devices.  On the other hand, lxc should have all device privileges.
The solution is adding a flag parameter.

This also lets us restrict write access to read-only disks.

* src/util/cgroup.h (virCgroup*Device*): Adjust prototypes.
* src/util/cgroup.c (virCgroupAllowDevice)
(virCgroupAllowDeviceMajor, virCgroupAllowDevicePath)
(virCgroupDenyDevice, virCgroupDenyDeviceMajor)
(virCgroupDenyDevicePath): Add parameter.
* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Update clients.
* src/lxc/lxc_controller.c (lxcSetContainerResources): Likewise.
* src/qemu/qemu_cgroup.c: Likewise.
(qemuSetupDiskPathAllow): Also, honor read-only disks.
src/lxc/lxc_controller.c
src/qemu/qemu_cgroup.c
src/qemu/qemu_driver.c
src/util/cgroup.c
src/util/cgroup.h