]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Fix read-side race on updates to vcpu reset state
authorOliver Upton <oupton@google.com>
Wed, 18 Aug 2021 20:21:30 +0000 (20:21 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 19 Aug 2021 08:08:56 +0000 (09:08 +0100)
commit10a3d078a44f33327104279302a2697ea69cad0e
treefd54c1cfff1f8bd1d13672699fc2b32b657f3aed
parenta626f522ee79447ed56acaaf81ccbb30681f81d8
KVM: arm64: Fix read-side race on updates to vcpu reset state

KVM correctly serializes writes to a vCPU's reset state, however since
we do not take the KVM lock on the read side it is entirely possible to
read state from two different reset requests.

Cure the race for now by taking the KVM lock when reading the
reset_state structure.

Fixes: 71aa21ca05c4 ("arm/arm64: KVM: Allow a VCPU to fully reset itself")
Signed-off-by: Oliver Upton <oupton@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210818202133.1106786-2-oupton@google.com
arch/arm64/kvm/reset.c