|
|
6d1f90 |
From b21c8cad6d25e328bb93f1ec218546f09c2fbed4 Mon Sep 17 00:00:00 2001
|
|
|
6d1f90 |
Message-Id: <b21c8cad6d25e328bb93f1ec218546f09c2fbed4@dist-git>
|
|
|
6d1f90 |
From: Erik Skultety <eskultet@redhat.com>
|
|
|
6d1f90 |
Date: Fri, 22 Nov 2019 11:19:25 +0100
|
|
|
6d1f90 |
Subject: [PATCH] qemu: Fix NULL ptr dereference caused by
|
|
|
6d1f90 |
qemuDomainDefFormatBufInternal
|
|
|
6d1f90 |
|
|
|
6d1f90 |
qemuDomainDefFormatBufInternal function wasn't testing whether the CPU
|
|
|
6d1f90 |
was actually defined in the XML and saving such a domain resulted in the
|
|
|
6d1f90 |
following backtrace:
|
|
|
6d1f90 |
|
|
|
6d1f90 |
0 in qemuDomainMakeCPUMigratable (cpu=0x0)
|
|
|
6d1f90 |
1 in qemuDomainDefFormatBufInternal()
|
|
|
6d1f90 |
2 in qemuDomainDefFormatXMLInternal()
|
|
|
6d1f90 |
3 in qemuDomainDefFormatLive()
|
|
|
6d1f90 |
4 in qemuDomainSaveInternal()
|
|
|
6d1f90 |
5 in qemuDomainSaveFlags()
|
|
|
6d1f90 |
6 in qemuDomainSave()
|
|
|
6d1f90 |
7 in virDomainSave()
|
|
|
6d1f90 |
|
|
|
6d1f90 |
Signed-off-by: Erik Skultety <eskultet@redhat.com>
|
|
|
6d1f90 |
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
|
|
|
6d1f90 |
(cherry picked from commit 2816fe2e846ab3bd2bfbef123c426a17f1e1df98)
|
|
|
6d1f90 |
|
|
|
6d1f90 |
https://bugzilla.redhat.com/show_bug.cgi?id=1775133
|
|
|
6d1f90 |
https://bugzilla.redhat.com/show_bug.cgi?id=1775134
|
|
|
6d1f90 |
https://bugzilla.redhat.com/show_bug.cgi?id=1775137
|
|
|
6d1f90 |
|
|
|
6d1f90 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
6d1f90 |
Message-Id: <13caf98777b14c8bc341de37a85c4dc04a50d78e.1574417839.git.jdenemar@redhat.com>
|
|
|
6d1f90 |
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
6d1f90 |
---
|
|
|
6d1f90 |
src/qemu/qemu_domain.c | 2 +-
|
|
|
6d1f90 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
6d1f90 |
|
|
|
6d1f90 |
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
|
|
6d1f90 |
index f45d7d427e..6b867ad669 100644
|
|
|
6d1f90 |
--- a/src/qemu/qemu_domain.c
|
|
|
6d1f90 |
+++ b/src/qemu/qemu_domain.c
|
|
|
6d1f90 |
@@ -7543,7 +7543,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver,
|
|
|
6d1f90 |
goto cleanup;
|
|
|
6d1f90 |
}
|
|
|
6d1f90 |
|
|
|
6d1f90 |
- if (qemuDomainMakeCPUMigratable(def->cpu) < 0)
|
|
|
6d1f90 |
+ if (def->cpu && qemuDomainMakeCPUMigratable(def->cpu) < 0)
|
|
|
6d1f90 |
goto cleanup;
|
|
|
6d1f90 |
}
|
|
|
6d1f90 |
|
|
|
6d1f90 |
--
|
|
|
6d1f90 |
2.24.0
|
|
|
6d1f90 |
|