All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] iommu/vt-d: Missing checks for pasid tables if allocation fails
@ 2017-10-19  0:39 ` Lu Baolu
  0 siblings, 0 replies; 13+ messages in thread
From: Lu Baolu @ 2017-10-19  0:39 UTC (permalink / raw)
  To: joro, dwmw2; +Cc: ashok.raj, jacob.jun.pan, iommu, linux-kernel, Lu Baolu

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))
 		return -EINVAL;
 
 	if (dev_is_pci(dev)) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-11-07  2:57 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-19  0:39 [PATCH 1/3] iommu/vt-d: Missing checks for pasid tables if allocation fails Lu Baolu
2017-10-19  0:39 ` Lu Baolu
2017-10-19  0:39 ` [PATCH 2/3] iommu/vt-d: Clear Page Request Overflow fault bit Lu Baolu
2017-10-19  0:39 ` [PATCH 3/3] iommu/vt-d: Clear pasid table entry when memory unbound Lu Baolu
2017-10-19  6:40 ` [PATCH 1/3] iommu/vt-d: Missing checks for pasid tables if allocation fails Liu, Yi L
2017-10-20  0:48   ` Lu Baolu
2017-10-20  0:48     ` Lu Baolu
2017-10-20  6:32     ` Liu, Yi L
2017-10-20  6:32       ` Liu, Yi L
2017-11-06 20:13 ` Alex Williamson
2017-11-06 20:13   ` Alex Williamson
2017-11-07  2:57   ` Lu Baolu
2017-11-07  2:57     ` Lu Baolu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.