qemu: Avoid using stale data in virDomainGetBlockInfo
authorJiri Denemark <jdenemar@redhat.com>
Fri, 20 Dec 2013 13:50:02 +0000 (14:50 +0100)
committerEric Blake <eblake@redhat.com>
Wed, 15 Jan 2014 18:01:53 +0000 (11:01 -0700)
commit12ca0aaf2fc32647d3a570780a2c7467a26b0ecd
tree7d49da7a780d6a47173fe243ef5b100cf2b25c1e
parent59d46c6cd5cb892ce68e83c99c14023f29e073a7
qemu: Avoid using stale data in virDomainGetBlockInfo

CVE-2013-6458

Generally, every API that is going to begin a job should do that before
fetching data from vm->def. However, qemuDomainGetBlockInfo does not
know whether it will have to start a job or not before checking vm->def.
To avoid using disk alias that might have been freed while we were
waiting for a job, we use its copy. In case the disk was removed in the
meantime, we will fail with "cannot find statistics for device '...'"
error message.

(cherry picked from commit b799259583bd65c0b2f5042e6c3ff19637ade881)

Conflicts:
src/qemu/qemu_driver.c - VIR_STRDUP not backported
src/qemu/qemu_driver.c