qemu-e2k/hw/i386
P J P 4c1396cb57 i386: avoid null pointer dereference
Hello,

A null pointer dereference issue was reported by Mr Ling Liu, CC'd here. It
occurs while doing I/O port write operations via hmp interface. In that,
'current_cpu' remains null as it is not called from cpu_exec loop, which
results in the said issue.

Below is a proposed (tested)patch to fix this issue; Does it look okay?

===
From ae88a4947fab9a148cd794f8ad2d812e7f5a1d0f Mon Sep 17 00:00:00 2001
From: Prasad J Pandit <pjp@fedoraproject.org>
Date: Fri, 18 Dec 2015 11:16:07 +0530
Subject: [PATCH] i386: avoid null pointer dereference

When I/O port write operation is called from hmp interface,
'current_cpu' remains null, as it is not called from cpu_exec()
loop. This leads to a null pointer dereference in vapic_write
routine. Add check to avoid it.

Reported-by: Ling Liu <liuling-it@360.cn>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-Id: <alpine.LFD.2.20.1512181129320.9805@wniryva>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: P J P <ppandit@redhat.com>
2016-01-15 18:58:01 +01:00
..
kvm pci-assign: Clean up "Failed to assign" error messages 2016-01-13 15:16:18 +01:00
xen xen-platform: Replace assert() with appropriate error reporting 2015-10-26 11:32:24 +00:00
acpi-build.c pc: acpi: switch to AML API composed DSDT 2016-01-09 23:20:19 +02:00
acpi-build.h i386: ACPI table generation code from seabios 2013-10-14 17:48:57 +03:00
intel_iommu_internal.h intel-iommu: add IOTLB using hash table 2014-08-28 23:10:22 +02:00
intel_iommu.c intel_iommu: Add support for translation for devices behind bridges 2015-10-18 10:05:43 +03:00
kvmvapic.c i386: avoid null pointer dereference 2016-01-15 18:58:01 +01:00
Makefile.objs pc: acpi: remove unused ASL templates and related blobs/utils 2016-01-09 23:20:19 +02:00
multiboot.c i386: Rename ELF_MACHINE to be x86 specific 2015-09-25 12:04:44 +02:00
multiboot.h refer to FWCfgState explicitly 2013-06-02 18:14:02 +03:00
pc_piix.c isa: Clean up error handling around isa_bus_new() 2016-01-13 11:58:59 +01:00
pc_q35.c pc: Add pc-*-2.6 machine classes 2015-12-22 18:39:19 +02:00
pc_sysfw.c Fix bad error handling after memory_region_init_ram() 2015-09-18 14:39:29 +02:00
pc.c error: Clean up errors with embedded newlines (again) 2016-01-13 15:16:18 +01:00
pci-assign-load-rom.c pci-assign: do not test path with access() before opening 2015-11-06 15:42:38 +03:00