linux/arch/arm/kvm
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
..
arm.c KVM: Protect device ops->create and list_add with kvm->lock 2019-03-25 17:32:35 +00:00
coproc.c KVM: ARM/arm64: avoid returning negative error code as bool 2015-05-20 13:25:43 +01:00
coproc.h ARM: KVM: trap VM system registers until MMU and caches are ON 2014-03-03 01:15:24 +00:00
coproc_a7.c ARM: KVM: trap VM system registers until MMU and caches are ON 2014-03-03 01:15:24 +00:00
coproc_a15.c ARM: KVM: trap VM system registers until MMU and caches are ON 2014-03-03 01:15:24 +00:00
emulate.c arm/arm64: KVM: set right LR register value for 32 bit guest when inject abort 2018-01-01 20:51:57 +00:00
guest.c arm/arm64: KVM: Fix ioctl error handling 2016-03-24 10:00:58 +00:00
handle_exit.c arm: KVM: Fix SMCCC handling of unimplemented SMC/HVC calls 2018-06-16 22:22:06 +01:00
init.S arm: KVM: Allow unaligned accesses at HYP 2017-09-15 18:30:04 +01:00
interrupts.S arm: KVM: force execution of HCPTR access on VM exit 2015-07-15 10:00:39 +01:00
interrupts_head.S arm: KVM: Disable virtual timer even if the guest is not using it 2015-10-06 11:52:29 +01:00
Kconfig ARM: KVM: disable KVM in Kconfig on big-endian systems 2014-04-26 04:20:03 -07:00
Makefile KVM: ARM: Add support for Cortex-A7 2013-10-12 17:45:30 -07:00
mmio.c KVM: Fix stack-out-of-bounds read in write_mmio 2018-01-01 20:52:11 +00:00
mmu.c KVM: arm/arm64: Skip updating PTE entry if no change 2018-12-16 22:08:44 +00:00
perf.c ARM: KVM: add support for minimal host vs guest profiling 2013-04-28 21:44:01 -07:00
psci.c KVM: arm/arm64: fix races in kvm_psci_vcpu_on 2017-08-26 02:14:36 +01:00
reset.c Updates for KVM/ARM, take 3 supporting more than 4 CPUs. 2013-11-11 12:02:27 +01:00
trace.h ARM: KVM: Simplify tracepoint text 2013-08-30 15:47:53 -07:00