Skip to content
Commit 6c7a5dce authored by Andrew Jones's avatar Andrew Jones Committed by Christoffer Dall
Browse files

KVM: arm/arm64: fix races in kvm_psci_vcpu_on



Fix potential races in kvm_psci_vcpu_on() by taking the kvm->lock
mutex.  In general, it's a bad idea to allow more than one PSCI_CPU_ON
to process the same target VCPU at the same time.  One such problem
that may arise is that one PSCI_CPU_ON could be resetting the target
vcpu, which fills the entire sys_regs array with a temporary value
including the MPIDR register, while another looks up the VCPU based
on the MPIDR value, resulting in no target VCPU found.  Resolves both
races found with the kvm-unit-tests/arm/psci unit test.

Reviewed-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Reviewed-by: default avatarChristoffer Dall <cdall@linaro.org>
Reported-by: default avatarLevente Kurusa <lkurusa@redhat.com>
Suggested-by: default avatarChristoffer Dall <cdall@linaro.org>
Signed-off-by: default avatarAndrew Jones <drjones@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarChristoffer Dall <cdall@linaro.org>
parent 5f6e0070
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment