From: Jason Gunthorpe <jgg@nvidia.com>
To: Yan Zhao <yan.y.zhao@intel.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
alex.williamson@redhat.com, kevin.tian@intel.com
Subject: Re: [PATCH] vfio/type1: check pfn valid before converting to struct page
Date: Tue, 16 May 2023 08:50:07 -0300 [thread overview]
Message-ID: <ZGNt735oC1n73rfp@nvidia.com> (raw)
In-Reply-To: <20230516093007.15234-1-yan.y.zhao@intel.com>
On Tue, May 16, 2023 at 05:30:07PM +0800, Yan Zhao wrote:
> vfio_pin_page_external() can return a phys_pfn for vma with VM_PFNMAP,
> e.g. for MMIO PFNs.
>
> It's necessary to check if it's a valid pfn before calling pfn_to_page().
>
> Fixes: 34a255e67615 ("vfio: Replace phys_pfn with pages for vfio_pin_pages()")
> Signed-off-by: Yan Zhao <yan.y.zhao@intel.com>
> ---
> drivers/vfio/vfio_iommu_type1.c | 5 +++++
> 1 file changed, 5 insertions(+)
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Jason
next prev parent reply other threads:[~2023-05-16 11:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-16 9:30 [PATCH] vfio/type1: check pfn valid before converting to struct page Yan Zhao
2023-05-16 11:50 ` Jason Gunthorpe [this message]
2023-05-17 15:19 ` Sean Christopherson
2023-05-18 0:52 ` Yan Zhao
2023-05-18 18:07 ` Sean Christopherson
2023-05-19 1:25 ` Yan Zhao
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=ZGNt735oC1n73rfp@nvidia.com \
--to=jgg@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yan.y.zhao@intel.com \
/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