public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: "Singh, Brijesh" <brijesh.singh@amd.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"iommu@lists.linux-foundation.org"
	<iommu@lists.linux-foundation.org>,
	"Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
	"Borislav Petkov" <bp@suse.de>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	"# 4 . 14+" <stable@vger.kernel.org>
Subject: Re: [PATCH] iommu/amd: Clear memory encryption mask from physical address
Date: Fri, 5 Oct 2018 10:31:01 +0200	[thread overview]
Message-ID: <20181005083101.GD3630@8bytes.org> (raw)
In-Reply-To: <1538689210-14524-1-git-send-email-brijesh.singh@amd.com>

On Thu, Oct 04, 2018 at 09:40:23PM +0000, Singh, Brijesh wrote:
> Boris Ostrovsky reported a memory leak with device passthrough when SME
> is active.
> 
> The VFIO driver uses iommu_iova_to_phys() to get the physical address for
> an iova. This physical address is later passed into vfio_unmap_unpin() to
> unpin the memory. The vfio_unmap_unpin() uses pfn_valid() before unpinning
> the memory. The pfn_valid() check was failing because encryption mask was
> part of the physical address returned. This resulted in the memory not
> being unpinned and therefore leaked after the guest terminates.
> 
> The memory encryption mask must be cleared from the physical address in
> iommu_iova_to_phys().

Merged and on its way upstream, thanks Brijesh.

      reply	other threads:[~2018-10-05  8:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 21:40 [PATCH] iommu/amd: Clear memory encryption mask from physical address Singh, Brijesh
2018-10-05  8:31 ` Joerg Roedel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181005083101.GD3630@8bytes.org \
    --to=joro@8bytes.org \
    --cc=Thomas.Lendacky@amd.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@suse.de \
    --cc=brijesh.singh@amd.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox