|
|
99cbc7 |
From 2ebba4a1ef6914c2b030b52c67c56d7aca49290f Mon Sep 17 00:00:00 2001
|
|
|
99cbc7 |
Message-Id: <2ebba4a1ef6914c2b030b52c67c56d7aca49290f@dist-git>
|
|
|
99cbc7 |
From: Andrea Bolognani <abologna@redhat.com>
|
|
|
99cbc7 |
Date: Fri, 7 Jun 2019 11:59:09 +0200
|
|
|
99cbc7 |
Subject: [PATCH] qemu: Fix NULL pointer access in qemuProcessInitCpuAffinity()
|
|
|
99cbc7 |
MIME-Version: 1.0
|
|
|
99cbc7 |
Content-Type: text/plain; charset=UTF-8
|
|
|
99cbc7 |
Content-Transfer-Encoding: 8bit
|
|
|
99cbc7 |
|
|
|
99cbc7 |
Commit 2f2254c7f4e5 attempted to fix a memory leak by ensuring
|
|
|
99cbc7 |
cpumapToSet is always a freshly allocated bitmap, but regrettably
|
|
|
99cbc7 |
introduced a NULL pointer access while doing so, because it called
|
|
|
99cbc7 |
virBitmapCopy() without allocating the destination bitmap first.
|
|
|
99cbc7 |
|
|
|
99cbc7 |
Solve the issue by using virBitmapNewCopy() instead.
|
|
|
99cbc7 |
|
|
|
99cbc7 |
Reported-by: John Ferlan <jferlan@redhat.com>
|
|
|
99cbc7 |
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
|
|
99cbc7 |
Reviewed-by: Erik Skultety <eskultet@redhat.com>
|
|
|
99cbc7 |
Reviewed-by: John Ferlan <jferlan@redhat.com>
|
|
|
99cbc7 |
(cherry picked from commit a84922c09e9e1a0ca4f8fb1e8b4b1c7b55bd79e9)
|
|
|
99cbc7 |
|
|
|
99cbc7 |
https://bugzilla.redhat.com/show_bug.cgi?id=1718172
|
|
|
99cbc7 |
|
|
|
99cbc7 |
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
|
|
99cbc7 |
Message-Id: <20190607095909.5538-3-abologna@redhat.com>
|
|
|
99cbc7 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
99cbc7 |
---
|
|
|
99cbc7 |
src/qemu/qemu_process.c | 2 +-
|
|
|
99cbc7 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
99cbc7 |
|
|
|
99cbc7 |
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
|
|
99cbc7 |
index f68a345c54..9e6e6528e2 100644
|
|
|
99cbc7 |
--- a/src/qemu/qemu_process.c
|
|
|
99cbc7 |
+++ b/src/qemu/qemu_process.c
|
|
|
99cbc7 |
@@ -2391,7 +2391,7 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
|
|
|
99cbc7 |
if (virNumaNodesetToCPUset(nodeset, &cpumapToSet) < 0)
|
|
|
99cbc7 |
return -1;
|
|
|
99cbc7 |
} else if (vm->def->cputune.emulatorpin) {
|
|
|
99cbc7 |
- if (virBitmapCopy(cpumapToSet, vm->def->cputune.emulatorpin) < 0)
|
|
|
99cbc7 |
+ if (!(cpumapToSet = virBitmapNewCopy(vm->def->cputune.emulatorpin)))
|
|
|
99cbc7 |
return -1;
|
|
|
99cbc7 |
} else {
|
|
|
99cbc7 |
if (qemuProcessGetAllCpuAffinity(&cpumapToSet) < 0)
|
|
|
99cbc7 |
--
|
|
|
99cbc7 |
2.21.0
|
|
|
99cbc7 |
|