libvirt/src/qemu
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_qemu.aug qemu: Fix augeas support for migration ports 2013-10-18 18:30:13 +02:00
MIGRATION.txt qemu: Implement migration job phases 2011-07-27 08:45:09 -06:00
qemu_agent.c qemuAgentDispose: Reset lastError 2013-12-04 14:43:54 -07:00
qemu_agent.h qemu_agent: Move updater function for VCPU hotplug into qemu_agent.c 2013-07-31 14:25:43 +02:00
qemu_bridge_filter.c maint: avoid 'const fooPtr' in qemu 2013-10-14 14:34:38 -06:00
qemu_bridge_filter.h maint: avoid 'const fooPtr' in qemu 2013-10-14 14:34:38 -06:00
qemu_capabilities.c spice: detect if qemu can disable file transfer 2014-01-21 11:35:40 +01:00
qemu_capabilities.h spice: detect if qemu can disable file transfer 2014-01-21 11:35:40 +01:00
qemu_cgroup.c blkio: Setting throttle blkio cgroup for domain 2014-01-20 10:52:44 +08:00
qemu_cgroup.h Auto-detect existing cgroup placement 2013-07-23 22:46:31 +01:00
qemu_command.c spice: expose the QEMU disable file transfer option 2014-01-21 11:35:41 +01:00
qemu_command.h qemuBuildNicDevStr: Set vectors= on Multiqueue 2014-01-09 15:23:57 +01:00
qemu_conf.c qemu: Avoid crash in qemuDiskGetActualType 2014-01-22 11:33:31 +01:00
qemu_conf.h Renamed virDomainEventState to virObjectEventState 2013-12-10 11:35:34 +00:00
qemu_domain.c AArch64: Porting of armv7l conditons to run qemu for aarch64. 2014-01-06 11:02:24 -05:00
qemu_domain.h Use virObjectEventPtr instead of virDomainEventPtr 2013-12-10 12:45:21 +00:00
qemu_driver.c api: require write permission for guest agent interaction 2014-01-22 16:52:41 -07:00
qemu_driver.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
qemu_hostdev.c qemu: default to vfio for nodedev-detach 2013-12-03 11:58:26 +02:00
qemu_hostdev.h qemu: default to vfio for nodedev-detach 2013-12-03 11:58:26 +02:00
qemu_hotplug.c qemuBuildNicDevStr: Set vectors= on Multiqueue 2014-01-09 15:23:57 +01:00
qemu_hotplug.h qemu: hotplug: Mark 2 private functions as static 2013-12-05 15:34:54 -05:00
qemu_hotplugpriv.h qemu: Let tests override waiting time for device unplug 2013-08-26 16:09:55 +02:00
qemu_migration.c maint: don't lose error on canceled migration 2014-01-16 12:26:54 -07:00
qemu_migration.h qemu: Implement support for VIR_MIGRATE_PARAM_LISTEN_ADDRESS 2013-10-11 11:08:55 +02:00
qemu_monitor_json.c qemuMonitorJSONGetCPUx86Data: Don't fail on ancient qemus 2013-11-19 16:28:16 +01:00
qemu_monitor_json.h qemu: Change return type of qemuMonitorGetGuestCPU() 2013-11-12 19:35:51 +01:00
qemu_monitor_text.c Convert 'int i' to 'size_t i' in src/qemu files 2013-07-10 17:55:15 +01:00
qemu_monitor_text.h qemu: Use bool instead of int in qemuMonitorSetCPU APIs 2013-06-07 15:57:03 +02:00
qemu_monitor.c qemu: Change the default unix monitor timeout 2014-01-16 17:20:08 +01:00
qemu_monitor.h Fix migration with QEMU 1.6 2013-11-15 13:50:47 +01:00
qemu_process.c maint: avoid nested use of virConnect{Ref,Close} 2014-01-16 12:25:45 -07:00
qemu_process.h qemu_process: Make qemuProcessReadLog() more versatile and reusable 2013-09-25 13:50:56 +02:00
qemu_processpriv.h qemu: Export qemuProcessHandleDeviceDeleted for tests 2013-08-26 16:09:55 +02:00
qemu.conf docs: grammar fixes 2013-11-08 10:37:06 -07:00
test_libvirtd_qemu.aug.in qemu: Fix augeas support for migration ports 2013-10-18 18:30:13 +02:00
THREADS.txt Remove qemuDriverLock from almost everywhere 2013-02-13 11:10:30 +00:00