[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 7/7] pc: fix crash on attempted cpu unplug
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 7/7] pc: fix crash on attempted cpu unplug |
Date: |
Fri, 1 Dec 2017 19:09:00 +0200 |
From: Igor Mammedov <address@hidden>
when qemu is started with '-no-acpi' CLI option, an attempt
to unplug a CPU using device_del results in null pointer
dereference at:
#0 object_get_class
#1 pc_machine_device_unplug_request_cb
#2 qmp_marshal_device_del
which is caused by pcms->acpi_dev == NULL due to ACPI support
being disabled.
Considering that ACPI support is necessary for unplug to work,
check that it's enabled and fail unplug request gracefully
if no acpi device were found.
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/i386/pc.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index c3afe5b..186545d 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1842,6 +1842,11 @@ static void pc_cpu_unplug_request_cb(HotplugHandler
*hotplug_dev,
X86CPU *cpu = X86_CPU(dev);
PCMachineState *pcms = PC_MACHINE(hotplug_dev);
+ if (!pcms->acpi_dev) {
+ error_setg(&local_err, "CPU hot unplug not supported without ACPI");
+ goto out;
+ }
+
pc_find_cpu_slot(MACHINE(pcms), cpu->apic_id, &idx);
assert(idx != -1);
if (idx == 0) {
--
MST
- [Qemu-devel] [PULL 0/7] pc, pci, virtio: fixes for rc3, Michael S. Tsirkin, 2017/12/01
- [Qemu-devel] [PULL 1/7] i386/msi: Correct mask of destination ID in MSI address, Michael S. Tsirkin, 2017/12/01
- [Qemu-devel] [PULL 2/7] virtio: Add queue interface to restore avail index from vring used index, Michael S. Tsirkin, 2017/12/01
- [Qemu-devel] [PULL 3/7] vhost: restore avail index from vring used index on disconnection, Michael S. Tsirkin, 2017/12/01
- [Qemu-devel] [PULL 4/7] dump-guest-memory.py: fix No symbol "vmcoreinfo_find", Michael S. Tsirkin, 2017/12/01
- [Qemu-devel] [PULL 5/7] vhost: fix error check in vhost_verify_ring_mappings(), Michael S. Tsirkin, 2017/12/01
- [Qemu-devel] [PULL 6/7] virtio: check VirtQueue Vring object is set, Michael S. Tsirkin, 2017/12/01
- [Qemu-devel] [PULL 7/7] pc: fix crash on attempted cpu unplug,
Michael S. Tsirkin <=
- Re: [Qemu-devel] [PULL 0/7] pc, pci, virtio: fixes for rc3, Peter Maydell, 2017/12/01
- Re: [Qemu-devel] [PULL 0/7] pc, pci, virtio: fixes for rc3, Michael S. Tsirkin, 2017/12/02
- Re: [Qemu-devel] [PULL 0/7] pc, pci, virtio: fixes for rc3, Peter Maydell, 2017/12/04
- Re: [Qemu-devel] [PULL 0/7] pc, pci, virtio: fixes for rc3, Peter Maydell, 2017/12/04
- Re: [Qemu-devel] [PULL 0/7] pc, pci, virtio: fixes for rc3, Michael S. Tsirkin, 2017/12/04