Commit f9f85bca authored by Sebastian Ene's avatar Sebastian Ene
Browse files

BACKPORT: FROMGIT: KVM: arm64: Fix circular locking dependency

The rule inside kvm enforces that the vcpu->mutex is taken *inside*
kvm->lock. The rule is violated by the pkvm_create_hyp_vm() which acquires
the kvm->lock while already holding the vcpu->mutex lock from
kvm_vcpu_ioctl(). Avoid the circular locking dependency altogether by
protecting the hyp vm handle with the config_lock, much like we already
do for other forms of VM-scoped data.

Bug: 321732950
(cherry picked from commit 10c02aad
 https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git )
Link: https://lore.kernel.org/kvmarm/20240124091027.1477174-2-sebastianene@google.com/


Change-Id: Iab3928147afc09d1b68747d9277923d140e9fa13
Signed-off-by: default avatarSebastian Ene <sebastianene@google.com>
Cc: stable@vger.kernel.org
parent 596ed30a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment