Skip to content

Commit d8b8591

Browse files
LuBaolujoergroedel
authored andcommitted
iommu/vt-d: Disable ATS support on untrusted devices
Commit fb58fdc ("iommu/vt-d: Do not enable ATS for untrusted devices") disables ATS support on the devices which have been marked as untrusted. Unfortunately this is not enough to fix the DMA attack vulnerabiltiies because IOMMU driver allows translated requests as long as a device advertises the ATS capability. Hence a malicious peripheral device could use this to bypass IOMMU. This disables the ATS support on untrusted devices by clearing the internal per-device ATS mark. As the result, IOMMU driver will block any translated requests from any device marked as untrusted. Cc: Jacob Pan <jacob.jun.pan@linux.intel.com> Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Suggested-by: Kevin Tian <kevin.tian@intel.com> Suggested-by: Ashok Raj <ashok.raj@intel.com> Fixes: fb58fdc ("iommu/vt-d: Do not enable ATS for untrusted devices") Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent fff4292 commit d8b8591

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/iommu/intel-iommu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2484,7 +2484,8 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
24842484
if (dev && dev_is_pci(dev)) {
24852485
struct pci_dev *pdev = to_pci_dev(info->dev);
24862486

2487-
if (!pci_ats_disabled() &&
2487+
if (!pdev->untrusted &&
2488+
!pci_ats_disabled() &&
24882489
ecap_dev_iotlb_support(iommu->ecap) &&
24892490
pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ATS) &&
24902491
dmar_find_matched_atsr_unit(pdev))

0 commit comments

Comments
 (0)