Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4fa064b2 authored by Lu Baolu's avatar Lu Baolu Committed by Alex Williamson
Browse files

iommu/vt-d: Clear pasid table entry when memory unbound



In intel_svm_unbind_mm(), pasid table entry must be cleared during
svm free. Otherwise, hardware may be set up with a wild pointer.

Suggested-by: default avatarAshok Raj <ashok.raj@intel.com>
Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 973b5464
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -458,6 +458,8 @@ int intel_svm_unbind_mm(struct device *dev, int pasid)
				kfree_rcu(sdev, rcu);

				if (list_empty(&svm->devs)) {
					svm->iommu->pasid_table[svm->pasid].val = 0;
					wmb();

					idr_remove(&svm->iommu->pasid_idr, svm->pasid);
					if (svm->mm)