]> xenbits.xensource.com Git - libvirt.git/commit
CVE-2014-8131: Fix possible deadlock and segfault in qemuConnectGetAllDomainStats()
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 27 Nov 2014 14:47:52 +0000 (15:47 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Wed, 10 Dec 2014 08:11:57 +0000 (09:11 +0100)
commit57023c0a3af4af1c547189c1f6712ed5edeb0c0b
tree45b481d51c0a0162c0c68ce5fc812c2b298dccc3
parentab8715506facc6a6d1e08b16b32f58a4c7bcfdcb
CVE-2014-8131: Fix possible deadlock and segfault in qemuConnectGetAllDomainStats()

When user doesn't have read access on one of the domains he requested,
the for loop could exit abruptly or continue and override pointer which
pointed to locked object.

This patch fixed two issues at once.  One is that domflags might have
had QEMU_DOMAIN_STATS_HAVE_JOB even when there was no job started (this
is fixed by doing domflags |= QEMU_DOMAIN_STATS_HAVE_JOB only when the
job was acquired and cleaning domflags on every start of the loop.
Second one is that the domain is kept locked when
virConnectGetAllDomainStatsCheckACL() fails and continues the loop when
it didn't end.  Adding a simple virObjectUnlock() and clearing the
pointer ought to do.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_driver.c