]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
pci: Block ATS requests when privileged mode is disabled
authorCLEMENT MATHIEU--DRIF <clement.mathieu--drif@eviden.com>
Wed, 29 Oct 2025 10:51:44 +0000 (10:51 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 5 Feb 2026 08:18:40 +0000 (03:18 -0500)
Signed-off-by: Clement Mathieu--Drif <clement.mathieu--drif@eviden.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251029105137.1097933-5-clement.mathieu--drif@eviden.com>

hw/pci/pci.c

index 9035caca92f63798a66eeb9a7125d1643545f000..90d6d71efdcfcbaa0da531523fb3e647e04c48a7 100644 (file)
@@ -3171,6 +3171,10 @@ ssize_t pci_ats_request_translation(PCIDevice *dev, uint32_t pasid,
         return -EPERM;
     }
 
+    if (priv_req && !pcie_pasid_priv_enabled(dev)) {
+        return -EPERM;
+    }
+
     pci_device_get_iommu_bus_devfn(dev, &iommu_bus, &bus, &devfn);
     if (iommu_bus && iommu_bus->iommu_ops->ats_request_translation) {
         return iommu_bus->iommu_ops->ats_request_translation(bus,