linux/arch/arm64/kvm
Steven Price c4d7c51845 KVM: arm64: Fix race when enabling KVM_ARM_CAP_MTE
When enabling KVM_CAP_ARM_MTE the ioctl checks that there are no VCPUs
created to ensure that the capability is enabled before the VM is
running. However no locks are held at that point so it is
(theoretically) possible for another thread in the VMM to create VCPUs
between the check and actually setting mte_enabled. Close the race by
taking kvm->lock.

Reported-by: Alexandru Elisei <alexandru.elisei@arm.com>
Fixes: 673638f434 ("KVM: arm64: Expose KVM_ARM_CAP_MTE")
Signed-off-by: Steven Price <steven.price@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210729160036.20433-1-steven.price@arm.com
2021-07-29 17:34:01 +01:00
..
hyp KVM: arm64: Fix off-by-one in range_is_memory 2021-07-29 17:33:04 +01:00
vgic
Kconfig
Makefile
arch_timer.c
arm.c KVM: arm64: Fix race when enabling KVM_ARM_CAP_MTE 2021-07-29 17:34:01 +01:00
debug.c
fpsimd.c
guest.c
handle_exit.c
hypercalls.c
inject_fault.c
irq.h
mmio.c
mmu.c KVM: arm64: Fix detection of shared VMAs on guest fault 2021-07-14 09:49:10 +01:00
perf.c
pmu-emul.c
pmu.c
psci.c
pvtime.c
reset.c
sys_regs.c
sys_regs.h
trace.h
trace_arm.h
trace_handle_exit.h
trng.c
va_layout.c
vgic-sys-reg-v3.c