Bug 2280152

Summary: Missing IOMMU hardening: enable CONFIG_IOMMU_DEFAULT_DMA_STRICT=1
Product: [Fedora] Fedora Reporter: jvoisin <julien.voisin+fedora>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 40CC: acaringi, adscvr, airlied, alciregi, bskeggs, hdegoede, hpa, jarod, jforbes, josef, kernel-maint, linville, masami256, mchehab, ptalbert, steved
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-06-26 18:36:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description jvoisin 2024-05-12 16:09:21 UTC
1. Please describe the problem:
It's currently possible for malicious devices to access stable data content. Having CONFIG_IOMMU_DEFAULT_DMA_STRICT=y would force proper IOMMU TLB invalidation, preventing this from happening.

This setting is recommended upstream: https://github.com/torvalds/linux/blob/master/kernel/configs/hardening.config#L72

The only possible issue would be that it might affect the performances on some platforms with cursed drivers.

2. What is the Version-Release number of the kernel:

N/A

3. Did it work previously in Fedora? If so, what kernel version did the issue
   *first* appear?  Old kernels are available for download at
   https://koji.fedoraproject.org/koji/packageinfo?packageID=8 :

No.

4. Can you reproduce this issue? If so, please provide the steps to reproduce
   the issue below:

Yes, rebuild with CONFIG_IOMMU_DEFAULT_DMA_STRICT, notice that nothing breaks on my machineā„¢. No need to rebuild the kernel if you're lazy, this option is equivalent to `iommu.passthrough=0 iommu.strict=1`


5. Does this problem occur with the latest Rawhide kernel? To install the
   Rawhide kernel, run ``sudo dnf install fedora-repos-rawhide`` followed by
   ``sudo dnf update --enablerepo=rawhide kernel``:

N/A

6. Are you running any modules that not shipped with directly Fedora's kernel?:

N/A

7. Please attach the kernel logs. You can get the complete kernel log
   for a boot with ``journalctl --no-hostname -k > dmesg.txt``. If the
   issue occurred on a previous boot, use the journalctl ``-b`` flag.

N/A

Reproducible: Always

Comment 1 Justin M. Forbes 2024-05-17 16:49:42 UTC
Will need to research this again, when it came in, I turned it on and it caused issues so was turned off.

Comment 2 jvoisin 2024-05-17 18:59:20 UTC
Do you have details about what kind of issues it caused?

Comment 3 Justin M. Forbes 2024-06-26 18:36:39 UTC
Yes, it turns out it is a significant performance impact. More details are available at: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/3952