summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorZenghui Yu (Huawei)2026-03-17 19:57:48 +0800
committerGreg Kroah-Hartman2026-04-02 13:25:41 +0200
commit4307e05e568782fc92eff651b09ee5dee88a058d (patch)
tree68a9cfd5c1d4eb682a6a5675fc26dbe48f5aea0b /arch
parent3795d13e035f1c0ebad95281776f892adab58105 (diff)
KVM: arm64: Fix the descriptor address in __kvm_at_swap_desc()
commit 0496acc42fb51eee040b5170cec05cec41385540 upstream. Using "(u64 __user *)hva + offset" to get the virtual addresses of S1/S2 descriptors looks really wrong, if offset is not zero. What we want to get for swapping is hva + offset, not hva + offset*8. ;-) Fix it. Fixes: f6927b41d573 ("KVM: arm64: Add helper for swapping guest descriptor") Signed-off-by: Zenghui Yu (Huawei) <zenghui.yu@linux.dev> Link: https://patch.msgid.link/20260317115748.47332-1-zenghui.yu@linux.dev Signed-off-by: Marc Zyngier <maz@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/kvm/at.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/kvm/at.c b/arch/arm64/kvm/at.c
index 808d26bed182..492fa7ab86c3 100644
--- a/arch/arm64/kvm/at.c
+++ b/arch/arm64/kvm/at.c
@@ -1785,7 +1785,7 @@ int __kvm_at_swap_desc(struct kvm *kvm, gpa_t ipa, u64 old, u64 new)
if (!writable)
return -EPERM;
- ptep = (u64 __user *)hva + offset;
+ ptep = (void __user *)hva + offset;
if (cpus_have_final_cap(ARM64_HAS_LSE_ATOMICS))
r = __lse_swap_desc(ptep, old, new);
else