kernel_optimize_test/arch/arm64/kvm
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: Save/restore sp_el0 as part of __guest_enter 2020-04-30 12:01:35 +01:00
debug.c
fpsimd.c
guest.c KVM: arm64: Fix 32bit PC wrap-around 2020-05-01 09:51:08 +01:00
handle_exit.c
hyp-init.S
hyp.S
inject_fault.c
irq.h
Kconfig
Makefile
pmu.c
regmap.c
reset.c
sys_regs_generic_v8.c
sys_regs.c
sys_regs.h
trace.h
va_layout.c
vgic-sys-reg-v3.c