From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B67F256E for ; Fri, 20 Jan 2023 14:14:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674224095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EidcY9Cmvk5OofxEtF9K5cCW7yBrnPNvX2al+ZtoBes=; b=d8ZKNHtRGcIGVRbDVxT8QitFs9FQVvehmEWG5Fb6d1MSzT2pB4uCj1JOvVHRTEYhslILwj TBW1gtu3KYSFjGWeVPV/X+ki/ak0bSc/SY5CozqOb/jZm4+kvUhQB3HLlq1oBvfhNKhjIO 5wqLZ/VxorkRtRid2uaS9hmUgyFoEGE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-609-_ez66BcsNz2ryGRk3A1axQ-1; Fri, 20 Jan 2023 09:14:52 -0500 X-MC-Unique: _ez66BcsNz2ryGRk3A1axQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E52E31818E7D; Fri, 20 Jan 2023 14:14:50 +0000 (UTC) Received: from localhost (unknown [10.39.193.175]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8486F1415113; Fri, 20 Jan 2023 14:14:50 +0000 (UTC) From: Cornelia Huck To: Catalin Marinas , Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Subject: Re: [PATCH] KVM: arm64: Pass the actual page address to mte_clear_page_tags() In-Reply-To: <20230119170902.1574756-1-catalin.marinas@arm.com> Organization: Red Hat GmbH References: <20230119170902.1574756-1-catalin.marinas@arm.com> User-Agent: Notmuch/0.37 (https://notmuchmail.org) Date: Fri, 20 Jan 2023 15:14:48 +0100 Message-ID: <87tu0lgunb.fsf@redhat.com> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain On Thu, Jan 19 2023, 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 > Cc: Marc Zyngier > --- > 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); Oops. Reviewed-by: Cornelia Huck From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F1688C05027 for ; Fri, 20 Jan 2023 14:18:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zLoJpVDQhTHVjRmtpan4Bze8VPCls7NyFy2dfM+sTTs=; b=NIG3zkHa8n63Lu I3n8uV50mlm/iy+kmNGtk5PvyDi1TTE1RSW1IVaUyC8oehqNzmZTKTTSOqulC4gCun686rz2lOC+M MpB4vWaiLLcvponoluF8El/lEo3SyuQLjM6jjMjWkp72ZJEaR+NE5+fftlTIoQu9fk6AS4ZteYwS+ 6nZgLM7SMHhCXsuIxDf4xILdI65b1Le5SRprxU6lLVP54NKzKh5WgNyAQrYaWFIPwd0HywysncwVj MyYzOBGZ5rOVih95zD8kjlxzIN/D/3T+aJvu1COz/G/6Y2JUmsFpwXM1XamOdtkycmR2wtDFkArcL 6AsL9BToCOQW6rsA1m7g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIsCo-00AemF-Ja; Fri, 20 Jan 2023 14:17:22 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIsCj-00AejS-8f for linux-arm-kernel@lists.infradead.org; Fri, 20 Jan 2023 14:17:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674224232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EidcY9Cmvk5OofxEtF9K5cCW7yBrnPNvX2al+ZtoBes=; b=hV3t2kpNF5O2utitpQk9rzO93nZajCQgkQbttEJlLwSq3N6Q+MQ/4RHulzMqJHP9fVdxfg DLMsbQa/1zKf6hJA05S7R8pDFWMUf4CUhudNvChlPM6th76oaX1FClPzSmr+O8LmsOogM4 h5heBXA1Cu8YIOFSDAMV3cqM8q2kcX4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-609-_ez66BcsNz2ryGRk3A1axQ-1; Fri, 20 Jan 2023 09:14:52 -0500 X-MC-Unique: _ez66BcsNz2ryGRk3A1axQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E52E31818E7D; Fri, 20 Jan 2023 14:14:50 +0000 (UTC) Received: from localhost (unknown [10.39.193.175]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8486F1415113; Fri, 20 Jan 2023 14:14:50 +0000 (UTC) From: Cornelia Huck To: Catalin Marinas , Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Subject: Re: [PATCH] KVM: arm64: Pass the actual page address to mte_clear_page_tags() In-Reply-To: <20230119170902.1574756-1-catalin.marinas@arm.com> Organization: Red Hat GmbH References: <20230119170902.1574756-1-catalin.marinas@arm.com> User-Agent: Notmuch/0.37 (https://notmuchmail.org) Date: Fri, 20 Jan 2023 15:14:48 +0100 Message-ID: <87tu0lgunb.fsf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230120_061717_431012_7A04EF49 X-CRM114-Status: GOOD ( 17.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jan 19 2023, 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 > Cc: Marc Zyngier > --- > 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); Oops. Reviewed-by: Cornelia Huck _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel