]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
PCI / ACPI: Identify untrusted PCI devices
authorMika Westerberg <mika.westerberg@linux.intel.com>
Fri, 15 Mar 2019 05:00:05 +0000 (13:00 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 1 Apr 2019 12:37:29 +0000 (14:37 +0200)
commit4fcbcb08b5f9207fa7d64702496036c60c7bafc1
tree1dc9c961ec2bbe7c867c1c2b38838e169690f5c4
parent997d2b15c21e09d5a38fe551c6c38858a104f1b3
PCI / ACPI: Identify untrusted PCI devices

BugLink: https://bugs.launchpad.net/bugs/1820153
A malicious PCI device may use DMA to attack the system. An external
Thunderbolt port is a convenient point to attach such a device. The OS
may use IOMMU to defend against DMA attacks.

Some BIOSes mark these externally facing root ports with this
ACPI _DSD [1]:

  Name (_DSD, Package () {
      ToUUID ("efcc06cc-73ac-4bc3-bff0-76143807c389"),
      Package () {
          Package () {"ExternalFacingPort", 1},
  Package () {"UID", 0 }
      }
  })

If we find such a root port, mark it and all its children as untrusted.
The rest of the OS may use this information to enable DMA protection
against malicious devices. For instance the device may be put behind an
IOMMU to keep it from accessing memory outside of what the driver has
allocated for it.

While at it, add a comment on top of prp_guids array explaining the
possible caveat resulting when these GUIDs are treated equivalent.

[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/pci/dsd-for-pcie-root-ports#identifying-externally-exposed-pcie-root-ports

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
(backported from commit 617654aae50eb59dd98aa53fb562e850937f4cde)
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Acked-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/acpi/property.c
drivers/pci/pci-acpi.c
drivers/pci/probe.c
include/linux/pci.h