CVE-2025-38062

Source
https://cve.org/CVERecord?id=CVE-2025-38062
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-38062.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-38062
Downstream
Related
Published
2025-06-18T09:33:41.282Z
Modified
2026-03-20T12:42:39.123004Z
Summary
genirq/msi: Store the IOMMU IOVA directly in msi_desc instead of iommu_cookie
Details

In the Linux kernel, the following vulnerability has been resolved:

genirq/msi: Store the IOMMU IOVA directly in msidesc instead of iommucookie

The IOMMU translation for MSI message addresses has been a 2-step process, separated in time:

1) iommudmaprepare_msi(): A cookie pointer containing the IOVA address is stored in the MSI descriptor when an MSI interrupt is allocated.

2) iommudmacomposemsimsg(): this cookie pointer is used to compute a translated message address.

This has an inherent lifetime problem for the pointer stored in the cookie that must remain valid between the two steps. However, there is no locking at the irq layer that helps protect the lifetime. Today, this works under the assumption that the iommu domain is not changed while MSI interrupts being programmed. This is true for normal DMA API users within the kernel, as the iommu domain is attached before the driver is probed and cannot be changed while a driver is attached.

Classic VFIO type1 also prevented changing the iommu domain while VFIO was running as it does not support changing the "container" after starting up.

However, iommufd has improved this so that the iommu domain can be changed during VFIO operation. This potentially allows userspace to directly race VFIODEVICEATTACHIOMMUFDPT (which calls iommuattachgroup()) and VFIODEVICESETIRQS (which calls into iommudmacomposemsi_msg()).

This potentially causes both the cookie pointer and the unlocked call to iommugetdomainfordev() on the MSI translation path to become UAFs.

Fix the MSI cookie UAF by removing the cookie pointer. The translated IOVA address is already known during iommudmaprepare_msi() and cannot change. Thus, it can simply be stored as an integer in the MSI descriptor.

The other UAF related to iommugetdomainfordev() will be addressed in patch "iommu: Make iommudmaprepare_msi() into a generic operation" by using the IOMMU group mutex.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38062.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
ece6e6f0218b7777e650bf93728130ae6f4feb7d
Fixed
e4d3763223c7b72ded53425207075e7453b4e3d5
Fixed
ba41e4e627db51d914444aee0b93eb67f31fa330
Fixed
53f42776e435f63e5f8e61955e4c205dbfeaf524
Fixed
856152eb91e67858a09e30a7149a1f29b04b7384
Fixed
1f7df3a691740a7736bbc99dc4ed536120eb4746

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-38062.json"