Skip to content
Snippets Groups Projects
Commit cb216b54 authored by Guido Günther's avatar Guido Günther
Browse files

CVE-2017-2635: qemu: Don't update physical storage size of empty drives

parent 62ad2899
No related branches found
No related tags found
No related merge requests found
From: Peter Krempa <pkrempa@redhat.com>
Date: Thu, 23 Feb 2017 10:07:30 +0100
Subject: CVE-2017-2635: qemu: Don't update physical storage size of empty
drives
Previously the code called virStorageSourceUpdateBlockPhysicalSize which
did not do anything on empty drives since it worked only on block
devices. After the refactor in c5f6151390 it's called for all devices
and thus attempts to deref the NULL path of empty drives.
Add a check that skips the update of the physical size if the storage
source is empty.
Upstream-Commit: c3de387380f6057ee0e46cd9f2f0a092e8070875
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1420718
---
src/qemu/qemu_driver.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d4422f3..2bb5906 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -11644,6 +11644,9 @@ qemuDomainStorageUpdatePhysical(virQEMUDriverPtr driver,
int fd = -1;
struct stat sb;
+ if (virStorageSourceIsEmpty(src))
+ return 0;
+
if (qemuDomainStorageOpenStat(driver, cfg, vm, src, &fd, &sb) < 0)
return -1;
...@@ -19,3 +19,4 @@ openpty-Skip-test-if-no-pty-is-available.patch ...@@ -19,3 +19,4 @@ openpty-Skip-test-if-no-pty-is-available.patch
test-posix_openpt-don-t-fail-on-EACCESS.patch test-posix_openpt-don-t-fail-on-EACCESS.patch
Disable-use-of-namespaces-by-default.patch Disable-use-of-namespaces-by-default.patch
debian/Debianize-virtlogd.patch debian/Debianize-virtlogd.patch
CVE-2017-2635-qemu-Don-t-update-physical-storage-size-of-.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment