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

Anshuman Khandual anshuman.khandual at arm.com
Fri Jan 20 04:08:51 PST 2023



On 1/19/23 22:39, Catalin Marinas wrote:
> Commit d77e59a8fccd ("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: d77e59a8fccd ("arm64: mte: Lock a page for MTE tag initialisation")
> Signed-off-by: Catalin Marinas <catalin.marinas at arm.com>
> Cc: Marc Zyngier <maz at kernel.org>

Reviewed-by: Anshuman Khandual <anshuman.khandual at arm.com>

> ---
>  arch/arm64/kvm/guest.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c
> index 5626ddb540ce..cf4c495a4321 100644
> --- a/arch/arm64/kvm/guest.c
> +++ b/arch/arm64/kvm/guest.c
> @@ -1079,7 +1079,7 @@ long kvm_vm_ioctl_mte_copy_tags(struct kvm *kvm,
>  
>  			/* uaccess failed, don't leave stale tags */
>  			if (num_tags != MTE_GRANULES_PER_PAGE)
> -				mte_clear_page_tags(page);
> +				mte_clear_page_tags(maddr);
>  			set_page_mte_tagged(page);
>  
>  			kvm_release_pfn_dirty(pfn);
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



More information about the linux-arm-kernel mailing list