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

Configure early boot DMA protection with IOMMU #222

Closed
miczyg1 opened this issue Oct 11, 2022 · 13 comments
Closed

Configure early boot DMA protection with IOMMU #222

miczyg1 opened this issue Oct 11, 2022 · 13 comments
Assignees
Labels
enhancement New feature or request

Comments

@miczyg1
Copy link
Contributor

miczyg1 commented Oct 11, 2022

The problem you're addressing (if any)
A rogue PCIe device may mess up the firmware/OS integrity with DMA transactions. IOMMU should be utilized to protect against such attacks.

Describe the solution you'd like
Configure the firmware to set up IOMMU early in the boot process and make firmware aware of IOMMU protection.

Where is the value to a user, and who might that user be?
#219 (comment)

Describe alternatives you've considered
None

Additional context
None

@miczyg1 miczyg1 added the enhancement New feature or request label Oct 11, 2022
@miczyg1 miczyg1 changed the title Configure early boot DMA protection with IOMMU. Configure early boot DMA protection with IOMMU Oct 11, 2022
@macpijan macpijan added this to To Do in Nlnet October 2022 Oct 14, 2022
@miczyg1 miczyg1 moved this from To Do to In progress in Nlnet October 2022 Oct 15, 2022
@miczyg1
Copy link
Contributor Author

miczyg1 commented Oct 15, 2022

Enabled the DMA protection for whole usable memory in coreboot, but as expected every device using/needing DMA now fails, i.e. can't use any USB device or disk 🙃 At least I have a confirmation that the DMA protection works 😄 Now the UEFIPayload needs to handle the allocation of DMA-allowed buffers for those I/O devices.

@miczyg1
Copy link
Contributor Author

miczyg1 commented Oct 15, 2022

@miczyg1
Copy link
Contributor Author

miczyg1 commented Oct 19, 2022

Yesterday I focused on fixing bugs in the patchsets and hunting down implications which DMA protection has on coreboot and found that PCIe5.0 firmware loading stops working. So I enabled DMA buffer in FSP and use it to fetch the firmware from ME and now it works. Pushing the patches to the new topic now which will aggregate whole effort: https://review.coreboot.org/q/topic:vtd_dma_protection

@pietrushnic
Copy link

@miczyg1 great news.

@miczyg1
Copy link
Contributor Author

miczyg1 commented Oct 26, 2022

Sent a patch to gerrit that allows cloning edk2-platform repo https://review.coreboot.org/c/coreboot/+/68872
So that we will be able to include VT-d driver in UEFI payload.

@miczyg1
Copy link
Contributor Author

miczyg1 commented Oct 27, 2022

PR with Intel VT-d driver integration: Dasharo/edk2#28

@miczyg1
Copy link
Contributor Author

miczyg1 commented Oct 27, 2022

I also had to do a workaround in the VT-d driver because coreboot already did PCI enumeration and it break dependencies of UEFI: Dasharo/edk2-platforms@3323ed4

@miczyg1
Copy link
Contributor Author

miczyg1 commented Oct 27, 2022

And the PR with configuration Dasharo/coreboot#250

@rafkoch
Copy link

rafkoch commented Nov 28, 2022

@miczyg1 what are we waiting for in this task, for more than a month, before we move it to the CLOSED status?

@miczyg1
Copy link
Contributor Author

miczyg1 commented Nov 29, 2022

We would also like to have a setup option to enable/disable DMA protection

@rafkoch
Copy link

rafkoch commented Nov 29, 2022

@miczyg1 for me, this looks like an additional improvement idea that was not in the original scope of issue. Please separate it to the backlog for future releases and link it here. Thank you.

@miczyg1
Copy link
Contributor Author

miczyg1 commented Nov 29, 2022

There it is: #275

@miczyg1 miczyg1 closed this as completed Nov 29, 2022
@rafkoch
Copy link

rafkoch commented Nov 29, 2022

Nice, I moved this isssue to DONE column.

@rafkoch rafkoch moved this from In progress to Done in Nlnet October 2022 Nov 29, 2022
@BeataZdunczyk BeataZdunczyk added this to the msi_ms7d25_v1.1.1 milestone Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

4 participants