linux-stable/virt/kvm/arm
Andre Przywara 27ea98a4c5 KVM: arm/arm64: VGIC/ITS: protect kvm_read_guest() calls with SRCU lock
commit bf308242ab upstream.

kvm_read_guest() will eventually look up in kvm_memslots(), which requires
either to hold the kvm->slots_lock or to be inside a kvm->srcu critical
section.
In contrast to x86 and s390 we don't take the SRCU lock on every guest
exit, so we have to do it individually for each kvm_read_guest() call.

Provide a wrapper which does that and use that everywhere.

Note that ending the SRCU critical section before returning from the
kvm_read_guest() wrapper is safe, because the data has been *copied*, so
we don't need to rely on valid references to the memslot anymore.

Cc: Stable <stable@vger.kernel.org> # 4.8+
Reported-by: Jan Glauber <jan.glauber@caviumnetworks.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@arm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-22 18:53:57 +02:00
..
hyp kvm: arm/arm64: vgic-v3: Tighten synchronization for guests using v2 on v3 2018-03-21 12:06:43 +01:00
vgic KVM: arm/arm64: VGIC/ITS: protect kvm_read_guest() calls with SRCU lock 2018-05-22 18:53:57 +02:00
aarch32.c KVM: arm64: Make kvm_condition_valid32() accessible from EL2 2017-06-15 09:44:58 +01:00
arch_timer.c KVM: arm/arm64: Reduce verbosity of KVM init log 2018-03-21 12:06:43 +01:00
arm.c KVM: arm/arm64: Close VMID generation race 2018-05-01 12:58:22 -07:00
mmio.c KVM: Fix stack-out-of-bounds read in write_mmio 2018-01-17 09:45:17 +01:00
mmu.c KVM: arm/arm64: Reduce verbosity of KVM init log 2018-03-21 12:06:43 +01:00
perf.c KVM: arm/arm64: Move shared files to virt/kvm/arm 2017-05-04 13:57:26 +02:00
pmu.c KVM: arm/arm64: PMU: Fix overflow interrupt injection 2017-07-25 14:18:01 +01:00
psci.c arm/arm64: KVM: Add PSCI version selection API 2018-05-01 12:58:27 -07:00
trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00