lkml.org 
[lkml]   [2017]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 1/3] iommu/vt-d: Missing checks for pasid tables if allocation fails
Date


> -----Original Message-----
> From: iommu-bounces@lists.linux-foundation.org [mailto:iommu-
> bounces@lists.linux-foundation.org] On Behalf Of Lu Baolu
> Sent: Thursday, October 19, 2017 8:39 AM
> To: joro@8bytes.org; dwmw2@infradead.org
> Cc: iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org
> Subject: [PATCH 1/3] iommu/vt-d: Missing checks for pasid tables if allocation fails
>
> intel_svm_alloc_pasid_tables() might return an error but never be checked by the
> callers. Later when intel_svm_bind_mm() is called, there are no checks for valid pasid
> tables before enabling them.
>
> Signed-off-by: Ashok Raj <ashok.raj@intel.com>
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> ---
> drivers/iommu/intel-svm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c index
> f6697e5..43280ca 100644
> --- a/drivers/iommu/intel-svm.c
> +++ b/drivers/iommu/intel-svm.c
> @@ -292,7 +292,7 @@ int intel_svm_bind_mm(struct device *dev, int *pasid, int
> flags, struct svm_dev_
> int pasid_max;
> int ret;
>
> - if (WARN_ON(!iommu))
> + if (WARN_ON(!iommu || !iommu->pasid_table))

[Liu, Yi L] Hi Baolu, I guess there also need a check to iommu->ecap , see if the pasid bit
is reported. thoughts?

Regards,
Yi L

> return -EINVAL;
>
> if (dev_is_pci(dev)) {
> --
> 2.7.4
>
> _______________________________________________
> iommu mailing list
> iommu@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu

\
 
 \ /
  Last update: 2017-10-22 17:20    [W:0.101 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site