linux/arch/arm64/kvm/hyp
Ryan Roberts 37a03de2d0 KVM: arm64: Fix bad dereference on MTE-enabled systems
commit b6bcdc9f6b upstream.

enter_exception64() performs an MTE check, which involves dereferencing
vcpu->kvm. While vcpu has already been fixed up to be a HYP VA pointer,
kvm is still a pointer in the kernel VA space.

This only affects nVHE configurations with MTE enabled, as in other
cases, the pointer is either valid (VHE) or not dereferenced (!MTE).

Fix this by first converting kvm to a HYP VA pointer.

Fixes: ea7fc1bb1c ("KVM: arm64: Introduce MTE VM feature")
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
[maz: commit message tidy-up]
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20221027120945.29679-1-ryan.roberts@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-11-10 18:15:41 +01:00
..
include KVM: arm64: Avoid consuming a stale esr value when SError occur 2022-02-08 18:34:06 +01:00
nvhe KVM: arm64: Don't return from void function 2022-08-17 14:23:49 +02:00
vhe KVM: arm64: Don't return from void function 2022-08-17 14:23:49 +02:00
aarch32.c KVM: arm64: Move kvm_vcpu_trap_il_is32bit into kvm_skip_instr32() 2020-11-10 08:34:24 +00:00
entry.S KVM: arm64: Save/restore MTE registers 2021-06-22 14:08:05 +01:00
exception.c KVM: arm64: Fix bad dereference on MTE-enabled systems 2022-11-10 18:15:41 +01:00
fpsimd.S KVM: arm64: Rework SVE host-save/guest-restore 2021-03-18 13:57:37 +00:00
hyp-entry.S arm64: Use the clearbhb instruction in mitigations 2022-03-11 12:22:35 +01:00
Makefile KVM: arm64: Prepare the creation of s1 mappings at EL2 2021-03-19 12:01:21 +00:00
pgtable.c KVM: arm64: pkvm: Use the mm_ops indirection for cache maintenance 2022-02-01 17:27:09 +01:00
reserved_mem.c memblock: make memblock_find_in_range method private 2021-09-03 09:58:17 -07:00
vgic-v2-cpuif-proxy.c KVM: arm64: Remove hyp_symbol_addr 2021-01-23 14:01:00 +00:00
vgic-v3-sr.c KVM: arm64: Fix CPU interface MMIO compatibility detection 2021-03-24 17:26:38 +00:00