iommu/vt-d: Don't apply gfx quirks to untrusted devices
authorRajat Jain <rajatja@google.com>
Mon, 22 Jun 2020 23:13:42 +0000 (07:13 +0800)
committerJoerg Roedel <jroedel@suse.de>
Tue, 23 Jun 2020 08:08:32 +0000 (10:08 +0200)
commit67e8a5b18d41af9298db5c17193f671f235cce01
treee5991d3e71905d65c9f8db8fd33e45ecd6a63dca
parent16ecf10e815d70d11d2300243f4a3b4c7c5acac7
iommu/vt-d: Don't apply gfx quirks to untrusted devices

Currently, an external malicious PCI device can masquerade the VID:PID
of faulty gfx devices, and thus apply iommu quirks to effectively
disable the IOMMU restrictions for itself.

Thus we need to ensure that the device we are applying quirks to, is
indeed an internal trusted device.

Signed-off-by: Rajat Jain <rajatja@google.com>
Reviewed-by: Ashok Raj <ashok.raj@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20200622231345.29722-4-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c