linux/virt/kvm/arm
Marc Zyngier 0225fd5e0a KVM: arm64: Fix 32bit PC wrap-around
In the unlikely event that a 32bit vcpu traps into the hypervisor
on an instruction that is located right at the end of the 32bit
range, the emulation of that instruction is going to increment
PC past the 32bit range. This isn't great, as userspace can then
observe this value and get a bit confused.

Conversly, userspace can do things like (in the context of a 64bit
guest that is capable of 32bit EL0) setting PSTATE to AArch64-EL0,
set PC to a 64bit value, change PSTATE to AArch32-USR, and observe
that PC hasn't been truncated. More confusion.

Fix both by:
- truncating PC increments for 32bit guests
- sanitizing all 32bit regs every time a core reg is changed by
  userspace, and that PSTATE indicates a 32bit mode.

Cc: stable@vger.kernel.org
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
2020-05-01 09:51:08 +01:00
..
hyp KVM: arm64: Fix 32bit PC wrap-around 2020-05-01 09:51:08 +01:00
vgic KVM: arm64: vgic-v4: Initialize GICv4.1 even in the absence of a virtual ITS 2020-04-30 12:50:23 +01:00
aarch32.c KVM: arm: Make inject_abt32() inject an external abort instead 2020-01-23 10:38:15 +00:00
arch_timer.c KVM: arm64: Use the correct timer structure to access the physical counter 2020-03-16 16:24:17 +00:00
arm.c KVM: Pass kvm_init()'s opaque param to additional arch funcs 2020-03-31 10:48:03 -04:00
hypercalls.c KVM: arm64: Support stolen time reporting via shared structure 2019-10-21 19:20:28 +01:00
mmio.c KVM: arm/arm64: Cleanup MMIO handling 2020-01-23 10:38:14 +00:00
mmu.c KVM: Terminate memslot walks via used_slots 2020-03-16 17:57:26 +01:00
perf.c KVM: Move running VCPU from ARM to common code 2020-01-27 19:59:54 +01:00
pmu.c KVM: arm64: pmu: Only handle supported event counters 2020-01-28 13:05:05 +00:00
psci.c KVM: arm64: PSCI: Forbid 64bit functions for 32bit guests 2020-04-17 09:51:45 +01:00
pvtime.c KVM: arm64: Provide VCPU attributes for stolen time 2019-10-21 19:20:29 +01:00
trace.h KVM: arm/arm64: Fix up includes for trace.h 2020-02-05 14:26:16 +00:00