Messages in this thread | | | Date | Tue, 16 May 2023 08:50:07 -0300 | From | Jason Gunthorpe <> | Subject | Re: [PATCH] vfio/type1: check pfn valid before converting to struct page |
| |
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
| |