Message ID | alpine.LFD.2.20.1512181129320.9805@wniryva |
---|---|
State | New |
Headers | show |
+-- On Fri, 18 Dec 2015, P J P wrote --+ | 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. Ping..! -> https://patchwork.ozlabs.org/patch/558748/ -- Prasad J Pandit / Red Hat Product Security Team 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
On 04/01/2016 16:49, P J P wrote: > +-- On Fri, 18 Dec 2015, P J P wrote --+ > | 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. > > Ping..! -> https://patchwork.ozlabs.org/patch/558748/ I was on vacation until today. I'll send a pull request some time next week. Paolo
+-- On Thu, 7 Jan 2016, Paolo Bonzini wrote --+ | On 04/01/2016 16:49, P J P wrote: | > Ping..! -> https://patchwork.ozlabs.org/patch/558748/ | | I was on vacation until today. I'll send a pull request some time next | week. Sure okay, thank you. -- Prasad J Pandit / Red Hat Product Security Team 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
=== 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> --- hw/i386/kvmvapic.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index c6d34b2..18157c7 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -634,6 +634,10 @@ static int vapic_prepare(VAPICROMState *s) static void vapic_write(void *opaque, hwaddr addr, uint64_t data, unsigned int size) { + if (!current_cpu) { + return; + } + CPUState *cs = current_cpu; X86CPU *cpu = X86_CPU(cs); CPUX86State *env = &cpu->env;