Commit 3de7d142 authored by Ryan Roberts's avatar Ryan Roberts Committed by Will Deacon
Browse files

BACKPORT: KVM: arm64: Fix bad dereference on MTE-enabled systems



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: ea7fc1bb ("KVM: arm64: Introduce MTE VM feature")
Signed-off-by: default avatarRyan Roberts <ryan.roberts@arm.com>
Reviewed-by: default avatarSteven Price <steven.price@arm.com>
[maz: commit message tidy-up]
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20221027120945.29679-1-ryan.roberts@arm.com


(cherry picked from commit b6bcdc9f)
[willdeacon@: Fixed conflict with aosp/2038249 rework moving MTE feature
 check into caller]
Signed-off-by: default avatarWill Deacon <willdeacon@google.com>
Bug: 233587962
Bug: 233588291
Change-Id: Id0aac0fc38dff2569081910af7468ecf97b6eca3
parent b684150a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment