WSL2-Linux-Kernel/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 KVM: arm64: vgic: Implement SW-driven deactivation 2021-06-01 10:46:00 +01:00
Kconfig kvm: Select SCHED_INFO instead of TASK_DELAY_ACCT 2021-05-12 11:43:24 +02:00
Makefile KVM: stats: Add fd-based API to read binary stats data 2021-06-24 11:47:57 -04:00
arch_timer.c KVM: arm64: timer: Add support for SW-based deactivation 2021-06-01 10:46:00 +01:00
arm.c KVM: arm64: Fix race when enabling KVM_ARM_CAP_MTE 2021-07-29 17:34:01 +01:00
debug.c Merge branch 'kvm-arm64/debug-5.13' into kvmarm-master/next 2021-04-13 15:34:15 +01:00
fpsimd.c
guest.c KVM/arm64 updates for v5.14. 2021-06-25 11:24:24 -04:00
handle_exit.c KVM: arm64: Log source when panicking from nVHE hyp 2021-04-01 09:54:37 +01:00
hypercalls.c KVM: arm64: Add support for the KVM PTP service 2021-04-07 16:33:20 +01:00
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 Merge branch 'kvm-arm64/kill_oprofile_dependency' into kvmarm-master/next 2021-04-22 13:41:49 +01:00
pmu-emul.c KVM: arm64: Restore PMU configuration on first run 2021-06-18 14:18:37 +01:00
pmu.c
psci.c
pvtime.c
reset.c KVM: arm64: Expose KVM_ARM_CAP_MTE 2021-06-22 14:08:06 +01:00
sys_regs.c KVM: arm64: Expose KVM_ARM_CAP_MTE 2021-06-22 14:08:06 +01:00
sys_regs.h
trace.h
trace_arm.h KVM: Move arm64's MMU notifier trace events to generic code 2021-04-17 08:30:56 -04:00
trace_handle_exit.h
trng.c
va_layout.c KVM: arm64: Generate final CTR_EL0 value when running in Protected mode 2021-03-25 11:00:33 +00:00
vgic-sys-reg-v3.c