1
0
Fork 0
alistair23-linux/arch
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
..
alpha mm/special: create generic fallbacks for pte_special() and pte_mkspecial() 2020-04-10 15:36:21 -07:00
arc mm/vma: define a default value for VM_DATA_DEFAULT_FLAGS 2020-04-10 15:36:21 -07:00
arm change email address for Pali Rohár 2020-04-10 15:36:22 -07:00
arm64 KVM: arm64: Fix 32bit PC wrap-around 2020-05-01 09:51:08 +01:00
c6x mm/vma: define a default value for VM_DATA_DEFAULT_FLAGS 2020-04-10 15:36:21 -07:00
csky mm/special: create generic fallbacks for pte_special() and pte_mkspecial() 2020-04-10 15:36:21 -07:00
h8300 Kbuild updates for v5.7 (2nd) 2020-04-11 09:46:12 -07:00
hexagon mm/special: create generic fallbacks for pte_special() and pte_mkspecial() 2020-04-10 15:36:21 -07:00
ia64 mm/memory_hotplug: add pgprot_t to mhp_params 2020-04-10 15:36:21 -07:00
m68k mm/special: create generic fallbacks for pte_special() and pte_mkspecial() 2020-04-10 15:36:21 -07:00
microblaze mm/special: create generic fallbacks for pte_special() and pte_mkspecial() 2020-04-10 15:36:21 -07:00
mips Kbuild updates for v5.7 (2nd) 2020-04-11 09:46:12 -07:00
nds32 mm/special: create generic fallbacks for pte_special() and pte_mkspecial() 2020-04-10 15:36:21 -07:00
nios2 nios2 update for v5.7-rc1 2020-04-11 11:38:44 -07:00
openrisc mm/special: create generic fallbacks for pte_special() and pte_mkspecial() 2020-04-10 15:36:21 -07:00
parisc mm/special: create generic fallbacks for pte_special() and pte_mkspecial() 2020-04-10 15:36:21 -07:00
powerpc mm/memory_hotplug: add pgprot_t to mhp_params 2020-04-10 15:36:21 -07:00
riscv mm/vma: define a default value for VM_DATA_DEFAULT_FLAGS 2020-04-10 15:36:21 -07:00
s390 Merge branch 'akpm' (patches from Andrew) 2020-04-10 17:57:48 -07:00
sh Kbuild updates for v5.7 (2nd) 2020-04-11 09:46:12 -07:00
sparc mm/special: create generic fallbacks for pte_special() and pte_mkspecial() 2020-04-10 15:36:21 -07:00
um mm/special: create generic fallbacks for pte_special() and pte_mkspecial() 2020-04-10 15:36:21 -07:00
unicore32 mm/special: create generic fallbacks for pte_special() and pte_mkspecial() 2020-04-10 15:36:21 -07:00
x86 A set of three patches to fix the fallout of the newly added split lock 2020-04-12 10:17:16 -07:00
xtensa Merge branch 'akpm' (patches from Andrew) 2020-04-10 17:57:48 -07:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
Kconfig dma-mapping updates for 5.7 2020-04-04 10:12:47 -07:00