libvirt/src/lxc
Eric Blake 7f2d27d1e3 api: require write permission for guest agent interaction
I noticed that we allow virDomainGetVcpusFlags even for read-only
connections, but that with a flag, it can require guest agent
interaction.  It is feasible that a malicious guest could
intentionally abuse the replies it sends over the guest agent
connection to possibly trigger a bug in libvirt's JSON parser,
or withhold an answer so as to prevent the use of the agent
in a later command such as a shutdown request.  Although we
don't know of any such exploits now (and therefore don't mind
posting this patch publicly without trying to get a CVE assigned),
it is better to err on the side of caution and explicitly require
full access to any domain where the API requires guest interaction
to operate correctly.

I audited all commands that are marked as conditionally using a
guest agent.  Note that at least virDomainFSTrim is documented
as needing a guest agent, but that such use is unconditional
depending on the hypervisor (so the existing domain:fs_trim ACL
should be sufficient there, rather than also requirng domain:write).
But when designing future APIs, such as the plans for obtaining
a domain's IP addresses, we should copy the approach of this patch
in making interaction with the guest be specified via a flag, and
use that flag to also require stricter access checks.

* src/libvirt.c (virDomainGetVcpusFlags): Forbid guest interaction
on read-only connection.
(virDomainShutdownFlags, virDomainReboot): Improve docs on agent
interaction.
* src/remote/remote_protocol.x
(REMOTE_PROC_DOMAIN_SNAPSHOT_CREATE_XML)
(REMOTE_PROC_DOMAIN_SET_VCPUS_FLAGS)
(REMOTE_PROC_DOMAIN_GET_VCPUS_FLAGS, REMOTE_PROC_DOMAIN_REBOOT)
(REMOTE_PROC_DOMAIN_SHUTDOWN_FLAGS): Require domain:write for any
conditional use of a guest agent.
* src/xen/xen_driver.c: Fix clients.
* src/libxl/libxl_driver.c: Likewise.
* src/uml/uml_driver.c: Likewise.
* src/qemu/qemu_driver.c: Likewise.
* src/lxc/lxc_driver.c: Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-01-22 16:52:41 -07:00
..
libvirtd_lxc.aug Add support for sVirt in the LXC driver 2012-02-02 17:44:39 -07:00
lxc_cgroup.c blkio: Setting throttle blkio cgroup for domain 2014-01-20 10:52:44 +08:00
lxc_cgroup.h Auto-detect existing cgroup placement 2013-07-23 22:46:31 +01:00
lxc_conf.c capabilities: add baselabel per sec driver/virt type to secmodel 2013-10-29 07:06:04 -06:00
lxc_conf.h maint: Fix messy include of libvirt_internal.h 2014-01-07 10:03:14 +01:00
lxc_container.c Set the 'container_ttys' env variable for LXC consoles 2013-12-18 11:21:10 +00:00
lxc_container.h LXC: Wire up the virDomainCreate{XML}WithFiles methods 2013-07-18 12:07:51 +01:00
lxc_controller.c LXC: create monitor socket under selinux context of domain 2014-01-08 11:10:03 +01:00
lxc_domain.c maint: avoid 'const fooPtr' in domain_conf 2013-10-14 14:34:38 -06:00
lxc_domain.h Store a virCgroupPtr instance in virLXCDomainObjPrivatePtr 2013-04-15 17:35:31 +01:00
lxc_driver.c api: require write permission for guest agent interaction 2014-01-22 16:52:41 -07:00
lxc_driver.h maint: don't use config.h in .h files 2013-06-05 05:53:25 -06:00
lxc_fuse.c Add missing 'return 0;' in stub lxcStartFuse() method impl. 2013-11-18 16:12:39 +00:00
lxc_fuse.h Avoid async signal safety problem in glibc's setxid 2013-11-18 15:36:23 +00:00
lxc_hostdev.c lxc: Make activeUsbHostdevs use locks 2013-07-18 14:16:54 +02:00
lxc_hostdev.h Rename all USB device functions to have a standard name prefix 2013-02-05 19:22:25 +00:00
lxc_monitor_protocol.x Fix generation of systemtap probes for RPC protocols 2013-03-14 12:42:22 +00:00
lxc_monitor.c virLXCMonitorClose: Unlock domain while closing monitor 2013-07-24 17:53:00 +02:00
lxc_monitor.h Fix generation of systemtap probes for RPC protocols 2013-03-14 12:42:22 +00:00
lxc_process.c maint: avoid nested use of virConnect{Ref,Close} 2014-01-16 12:25:45 -07:00
lxc_process.h lxc: switch to virCloseCallbacks API 2013-07-18 14:16:54 +02:00
lxc.conf Standardize whitespace used in example config files 2012-05-28 10:59:13 +01:00
test_libvirtd_lxc.aug.in Autogenerate augeas test case from default config files 2012-05-28 11:07:12 +01:00