arm/arm64: KVM: Don't allow creating VCPUs after vgic_initialized
authorChristoffer Dall <christoffer.dall@linaro.org>
Mon, 4 May 2015 01:25:14 +0000 (09:25 +0800)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 11 May 2015 11:07:33 +0000 (07:07 -0400)
commitc0a5bdaba1bc306b9fe5f69813948efc6f6396b4
tree01982fc9029dcdf261532e02c920048e4f289fc2
parent2da33f7dca212a8ae2b1ebaa6f311060119d6ffc
arm/arm64: KVM: Don't allow creating VCPUs after vgic_initialized

commit 716139df2517fbc3f2306dbe8eba0fa88dca0189 upstream.

When the vgic initializes its internal state it does so based on the
number of VCPUs available at the time.  If we allow KVM to create more
VCPUs after the VGIC has been initialized, we are likely to error out in
unfortunate ways later, perform buffer overflows etc.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Eric Auger <eric.auger@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
arch/arm/kvm/arm.c