提交 c3b37c2d 编写于 作者: C Catalin Marinas 提交者: Marc Zyngier

KVM: arm64: Pass the actual page address to mte_clear_page_tags()

Commit d77e59a8 ("arm64: mte: Lock a page for MTE tag
initialisation") added a call to mte_clear_page_tags() in case a
prior mte_copy_tags_from_user() failed in order to avoid stale tags in
the guest page (it should have really been a separate commit).
Unfortunately, the argument passed to this function was the address of
the struct page rather than the actual page address. Fix this function
call.

Fixes: d77e59a8 ("arm64: mte: Lock a page for MTE tag initialisation")
Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Reviewed-by: NOliver Upton <oliver.upton@linux.dev>
Reviewed-by: NAnshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: NCornelia Huck <cohuck@redhat.com>
Signed-off-by: NMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230119170902.1574756-1-catalin.marinas@arm.com
上级 de535c02
...@@ -1079,7 +1079,7 @@ long kvm_vm_ioctl_mte_copy_tags(struct kvm *kvm, ...@@ -1079,7 +1079,7 @@ long kvm_vm_ioctl_mte_copy_tags(struct kvm *kvm,
/* uaccess failed, don't leave stale tags */ /* uaccess failed, don't leave stale tags */
if (num_tags != MTE_GRANULES_PER_PAGE) if (num_tags != MTE_GRANULES_PER_PAGE)
mte_clear_page_tags(page); mte_clear_page_tags(maddr);
set_page_mte_tagged(page); set_page_mte_tagged(page);
kvm_release_pfn_dirty(pfn); kvm_release_pfn_dirty(pfn);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册