linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] PCI / iommu / thunderbolt: IOMMU based DMA protection
@ 2018-11-12 16:06 Mika Westerberg
  2018-11-12 16:06 ` [PATCH 1/4] PCI / ACPI: Identify external PCI devices Mika Westerberg
                   ` (5 more replies)
  0 siblings, 6 replies; 47+ messages in thread
From: Mika Westerberg @ 2018-11-12 16:06 UTC (permalink / raw)
  To: iommu
  Cc: Joerg Roedel, David Woodhouse, Lu Baolu, Ashok Raj,
	Bjorn Helgaas, Rafael J. Wysocki, Jacob jun Pan, Andreas Noever,
	Michael Jamet, Yehezkel Bernat, Lukas Wunner, Christian Kellner,
	Mario.Limonciello, Anthony Wong, Mika Westerberg, linux-acpi,
	linux-pci, linux-kernel

Hi all,

Recent systems shipping with Windows 10 version 1803 or newer may be
utilizing IOMMU to prevent DMA attacks via Thunderbolt ports. This is
different from the previous security level based scheme because the
connected device cannot access system memory outside of the regions
allocated for it by the driver.

When enabled the BIOS makes sure no device can do DMA outside of RMRR
(Reserved Memory Region Record) regions. This means that during OS boot,
before it enables IOMMU, none of the connected devices can bypass DMA
protection for instance by overwriting the data structures used by the
IOMMU. The BIOS communicates support for this to the OS by setting a new
bit in ACPI DMAR table [1].

Because these systems utilize an IOMMU to block possible DMA attacks,
typically (but not always) the Thunderbolt security level is set to "none"
which means that all PCIe devices are immediately usable. This also means
that Linux needs to follow Windows 10 and enable IOMMU automatically when
running on such system otherwise connected devices can read/write system
memory pretty much without any restrictions.

Since there is a way to identify PCIe root ports that are "external facing"
we can put all internal devices to pass through (identity mapping) mode and
only external devices need to go through full IOMMU mappings.

We also make sure PCIe ATS (Address Translation Service) is not enabled for
external devices because it could be used to bypass IOMMU completely as
explained in the changelog of patch 3/4.

Finally we expose this information to userspace so tools such as bolt can
do more accurate decision whether or not authorize the connected device.

[1] https://software.intel.com/sites/default/files/managed/c5/15/vt-directed-io-spec.pdf

Lu Baolu (1):
  iommu/vt-d: Force IOMMU on for platform opt in hint

Mika Westerberg (3):
  PCI / ACPI: Identify external PCI devices
  iommu/vt-d: Do not enable ATS for external devices
  thunderbolt: Export IOMMU based DMA protection support to userspace

 .../ABI/testing/sysfs-bus-thunderbolt         |  9 +++
 Documentation/admin-guide/thunderbolt.rst     | 23 ++++++++
 drivers/acpi/property.c                       |  3 +
 drivers/iommu/dmar.c                          | 25 ++++++++
 drivers/iommu/intel-iommu.c                   | 58 ++++++++++++++++++-
 drivers/pci/pci-acpi.c                        | 13 +++++
 drivers/pci/probe.c                           | 23 ++++++++
 drivers/thunderbolt/domain.c                  | 17 ++++++
 include/linux/dmar.h                          |  8 +++
 include/linux/pci.h                           |  1 +
 10 files changed, 177 insertions(+), 3 deletions(-)

-- 
2.19.1


^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2018-11-22 10:59 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-12 16:06 [PATCH 0/4] PCI / iommu / thunderbolt: IOMMU based DMA protection Mika Westerberg
2018-11-12 16:06 ` [PATCH 1/4] PCI / ACPI: Identify external PCI devices Mika Westerberg
2018-11-12 18:02   ` Lukas Wunner
2018-11-13 10:56     ` Lorenzo Pieralisi
2018-11-13 11:27       ` Mika Westerberg
2018-11-13 11:45         ` Lorenzo Pieralisi
2018-11-15 10:22           ` Mika Westerberg
2018-11-15 11:13             ` Lorenzo Pieralisi
2018-11-15 11:37               ` Mika Westerberg
2018-11-15 12:07                 ` Lukas Wunner
2018-11-15 12:16                   ` Mika Westerberg
2018-11-15 17:46                     ` Lorenzo Pieralisi
2018-11-15 17:58                       ` Yehezkel Bernat
2018-11-15 19:10                         ` Mika Westerberg
2018-11-15 19:27                           ` Lukas Wunner
2018-11-15 19:32                             ` Mika Westerberg
2018-11-16  9:18                           ` Christoph Hellwig
2018-11-16  9:32                             ` Mika Westerberg
2018-11-22 10:48                               ` Mika Westerberg
2018-11-22 10:59                                 ` Christoph Hellwig
2018-11-15 19:00                       ` Mika Westerberg
2018-11-15 19:33                         ` Mario.Limonciello
2018-11-16 10:57                           ` Lorenzo Pieralisi
2018-11-20 21:43                             ` Rafael J. Wysocki
2018-11-21 12:40                               ` Lorenzo Pieralisi
2018-11-16  7:01                         ` Mika Westerberg
2018-11-12 16:06 ` [PATCH 2/4] iommu/vt-d: Force IOMMU on for platform opt in hint Mika Westerberg
2018-11-12 17:49   ` Raj, Ashok
2018-11-12 18:09   ` Alex Williamson
2018-11-12 19:51     ` Raj, Ashok
2018-11-12 16:06 ` [PATCH 3/4] iommu/vt-d: Do not enable ATS for external devices Mika Westerberg
2018-11-12 17:53   ` Raj, Ashok
2018-11-12 16:06 ` [PATCH 4/4] thunderbolt: Export IOMMU based DMA protection support to userspace Mika Westerberg
2018-11-12 16:22   ` Mario.Limonciello
2018-11-13 10:36     ` Mika Westerberg
2018-11-12 16:59   ` Yehezkel Bernat
2018-11-13 10:55     ` Mika Westerberg
2018-11-13 11:13       ` Yehezkel Bernat
2018-11-13 11:40         ` Mika Westerberg
2018-11-13 14:42           ` Yehezkel Bernat
     [not found]             ` <20181113152038.GD2500@lahna.fi.intel.com>
2018-11-13 15:38               ` Yehezkel Bernat
2018-11-13 16:12                 ` Mika Westerberg
2018-11-12 18:12 ` [PATCH 0/4] PCI / iommu / thunderbolt: IOMMU based DMA protection Lukas Wunner
2018-11-12 19:04   ` Yehezkel Bernat
2018-11-13 11:13   ` Mika Westerberg
2018-11-13  8:54 ` Joerg Roedel
2018-11-13 11:32   ` Mika Westerberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).