linux/virt/kvm/arm
Christoffer Dall b68bf84b71 KVM: Protect device ops->create and list_add with kvm->lock
commit a28ebea2ad upstream.

KVM devices were manipulating list data structures without any form of
synchronization, and some implementations of the create operations also
suffered from a lack of synchronization.

Now when we've split the xics create operation into create and init, we
can hold the kvm->lock mutex while calling the create operation and when
manipulating the devices list.

The error path in the generic code gets slightly ugly because we have to
take the mutex again and delete the device from the list, but holding
the mutex during anon_inode_getfd or releasing/locking the mutex in the
common non-error path seemed wrong.

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
[bwh: Backported to 3.16:
 - Drop change to a failure path that doesn't exist in kvm_vgic_create() 
 - Adjust filename, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2019-03-25 17:32:35 +00:00
..
arch_timer.c arm/arm64: KVM: Require in-kernel vgic for the arch timers 2015-05-20 13:25:52 +01:00
vgic.c KVM: Protect device ops->create and list_add with kvm->lock 2019-03-25 17:32:35 +00:00