Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the status of pre-kDMAp IOMMU-enabled systems? #3

Open
tanriol opened this issue May 12, 2020 · 3 comments
Open

What's the status of pre-kDMAp IOMMU-enabled systems? #3

tanriol opened this issue May 12, 2020 · 3 comments

Comments

@tanriol
Copy link

tanriol commented May 12, 2020

Please document somewhere the protection status of systems that are pre-2019 and don't have the opt-in flag in the DMAR table, but do have an enabled IOMMU. Are they still "fully vulnerable", or are they only partially vulnerable (during boot/suspend/resume or something like that)?

@BjornRuytenberg
Copy link
Owner

BjornRuytenberg commented May 12, 2020

Thanks for the question. To enable Kernel DMA Protection, there are three requirements:

  1. The CPU provides an IOMMU
  2. UEFI enables the opt-in flag in the DMAR table
  3. The OS supports enforcing Kernel DMA Protection (DMA remapping of TB-related PCI endpoints)

The opt-in flag is required for the OS to have the IOMMU automatically restrict all PCIe endpoints, downstream of the Thunderbolt bridge, to their own memory range. Unfortunately, while systems might provide the first (both pre-2019 and since), this means they will not provide Kernel DMA Protection if the opt-in flag is not set, and are hence fully vulnerable.

I will have a look if we can clarify this on the webpage.

@tanriol
Copy link
Author

tanriol commented May 12, 2020

The point of my question is what happens when the opt-in flag is not present, but the system supports IOMMU? Does the absence of opt-in force the kernel (I'm primarily interested in Linux 5+) to provide full access to physical memory even though it has the ability to restrict it?

When the Thunderbolt controller is forced online in my system (a 2016 laptop), a number of devices comes up and for every new PCI-E device I see a line in dmesg saying "pci (address): Adding to iommu group (number)", and all the group numbers are different. Does this imply anything about protection? Is the kernel required to give full access to all these groups?

@tanriol
Copy link
Author

tanriol commented May 12, 2020

Also, is it possible to force the kernel to restrict them without the opt-in flag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants