{ "dataType": "CVE_RECORD", "dataVersion": "5.2", "cveMetadata": { "cveId": "CVE-2025-38062", "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "state": "PUBLISHED", "assignerShortName": "Linux", "dateReserved": "2025-04-16T04:51:23.979Z", "datePublished": "2025-06-18T09:33:41.282Z", "dateUpdated": "2026-08-05T11:59:10.586Z" }, "containers": { "cna": { "providerMetadata": { "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "shortName": "Linux", "dateUpdated": "2026-08-05T11:59:10.586Z" }, "descriptions": [ { "lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ngenirq/msi: Store the IOMMU IOVA directly in msi_desc instead of iommu_cookie\n\nThe IOMMU translation for MSI message addresses has been a 2-step process,\nseparated in time:\n\n 1) iommu_dma_prepare_msi(): A cookie pointer containing the IOVA address\n is stored in the MSI descriptor when an MSI interrupt is allocated.\n\n 2) iommu_dma_compose_msi_msg(): this cookie pointer is used to compute a\n translated message address.\n\nThis has an inherent lifetime problem for the pointer stored in the cookie\nthat must remain valid between the two steps. However, there is no locking\nat the irq layer that helps protect the lifetime. Today, this works under\nthe assumption that the iommu domain is not changed while MSI interrupts\nbeing programmed. This is true for normal DMA API users within the kernel,\nas the iommu domain is attached before the driver is probed and cannot be\nchanged while a driver is attached.\n\nClassic VFIO type1 also prevented changing the iommu domain while VFIO was\nrunning as it does not support changing the \"container\" after starting up.\n\nHowever, iommufd has improved this so that the iommu domain can be changed\nduring VFIO operation. This potentially allows userspace to directly race\nVFIO_DEVICE_ATTACH_IOMMUFD_PT (which calls iommu_attach_group()) and\nVFIO_DEVICE_SET_IRQS (which calls into iommu_dma_compose_msi_msg()).\n\nThis potentially causes both the cookie pointer and the unlocked call to\niommu_get_domain_for_dev() on the MSI translation path to become UAFs.\n\nFix the MSI cookie UAF by removing the cookie pointer. The translated IOVA\naddress is already known during iommu_dma_prepare_msi() and cannot change.\nThus, it can simply be stored as an integer in the MSI descriptor.\n\nThe other UAF related to iommu_get_domain_for_dev() will be addressed in\npatch \"iommu: Make iommu_dma_prepare_msi() into a generic operation\" by\nusing the IOMMU group mutex." } ], "metrics": [ { "cvssV3_1": { "version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH" }, "scenarios": [ { "lang": "en", "value": "AV:L - Exploitation requires issuing ioctls on local device nodes (/dev/vfio/devices/vfioN and /dev/iommu) — VFIO_DEVICE_SET_IRQS and VFIO_DEVICE_ATTACH_IOMMUFD_PT/IOMMUFD_DESTROY. There is no remote or adjacent-network path to iommu_dma_compose_msi_msg().\nAC:L - The attacker drives both halves entirely: the MSI descriptor is prepared in one ioctl and composed in a later one, so the domain can be replaced and freed in between without winning any race, and the freed 32-byte iommu_dma_msi_page can be groomed with a standard kmalloc-32 spray. Even treated as a race, both sides are attacker-issued ioctls on their own fds, and the affected arm64/SMMU + IOMMU_DMA configuration is the default.\nPR:L - The IOMMU-backed VFIO/iommufd path has no capability check — CAP_SYS_RAWIO gates only VFIO_NO_IOMMU mode — so only file-permission access to /dev/vfio/devices/* and /dev/iommu is needed, which is routinely granted to unprivileged accounts in device-assignment setups (libvirt-qemu, DPDK users).\nUI:N - The attacker performs every step themselves via ioctls on file descriptors they already hold; no victim action or cooperating process is involved.\nS:U - The freed object and the resulting corruption are both in the host kernel's own heap, and the forged MSI address is still translated by the newly attached IOMMU domain within the attacker's reserved-region-constrained IOAS, so no IOMMU/DMA or virtualization boundary is actually crossed.\nC:H - This is a use-after-free read whose result is programmed into the passthrough device's MSI-X address registers, which userspace can read back through the vfio-pci BAR access path, directly disclosing 64 bits of reallocated kernel slab content (potentially kernel pointers); the unlocked iommu_get_domain_for_dev() adds a second read of a freed struct iommu_domain.\nI:H - Use-after-free of an attacker-groomable kmalloc-32 object lets the attacker choose the 64-bit DMA target address written into device hardware, and per standard treatment a UAF with heap-spray control provides the primitives needed for kernel memory corruption and control-flow influence.\nA:H - Dereferencing the freed msi_page and the concurrently freed iommu_domain can oops or panic the kernel (KASAN-reportable UAF), and a stale/garbage MSI address causes SMMU fault storms and permanent loss of device interrupt delivery." } ] } ], "affected": [ { "product": "Linux", "vendor": "Linux", "defaultStatus": "unaffected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "drivers/iommu/dma-iommu.c", "include/linux/msi.h" ], "versions": [ { "version": "ece6e6f0218b7777e650bf93728130ae6f4feb7d", "lessThan": "e4d3763223c7b72ded53425207075e7453b4e3d5", "status": "affected", "versionType": "git" }, { "version": "ece6e6f0218b7777e650bf93728130ae6f4feb7d", "lessThan": "ba41e4e627db51d914444aee0b93eb67f31fa330", "status": "affected", "versionType": "git" }, { "version": "ece6e6f0218b7777e650bf93728130ae6f4feb7d", "lessThan": "53f42776e435f63e5f8e61955e4c205dbfeaf524", "status": "affected", "versionType": "git" }, { "version": "ece6e6f0218b7777e650bf93728130ae6f4feb7d", "lessThan": "856152eb91e67858a09e30a7149a1f29b04b7384", "status": "affected", "versionType": "git" }, { "version": "ece6e6f0218b7777e650bf93728130ae6f4feb7d", "lessThan": "1f7df3a691740a7736bbc99dc4ed536120eb4746", "status": "affected", "versionType": "git" } ] }, { "product": "Linux", "vendor": "Linux", "defaultStatus": "affected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "drivers/iommu/dma-iommu.c", "include/linux/msi.h" ], "versions": [ { "version": "5.2", "status": "affected" }, { "version": "0", "lessThan": "5.2", "status": "unaffected", "versionType": "semver" }, { "version": "6.1.141", "lessThanOrEqual": "6.1.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.6.93", "lessThanOrEqual": "6.6.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.12.31", "lessThanOrEqual": "6.12.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.14.9", "lessThanOrEqual": "6.14.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.15", "lessThanOrEqual": "*", "status": "unaffected", "versionType": "original_commit_for_fix" } ] } ], "cpeApplicability": [ { "nodes": [ { "operator": "OR", "negate": false, "cpeMatch": [ { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.2", "versionEndExcluding": "6.1.141" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.2", "versionEndExcluding": "6.6.93" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.2", "versionEndExcluding": "6.12.31" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.2", "versionEndExcluding": "6.14.9" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.2", "versionEndExcluding": "6.15" } ] } ] } ], "references": [ { "url": "https://git.kernel.org/stable/c/e4d3763223c7b72ded53425207075e7453b4e3d5" }, { "url": "https://git.kernel.org/stable/c/ba41e4e627db51d914444aee0b93eb67f31fa330" }, { "url": "https://git.kernel.org/stable/c/53f42776e435f63e5f8e61955e4c205dbfeaf524" }, { "url": "https://git.kernel.org/stable/c/856152eb91e67858a09e30a7149a1f29b04b7384" }, { "url": "https://git.kernel.org/stable/c/1f7df3a691740a7736bbc99dc4ed536120eb4746" } ], "title": "genirq/msi: Store the IOMMU IOVA directly in msi_desc instead of iommu_cookie", "x_generator": { "engine": "bippy-1.2.0" } }, "adp": [ { "title": "CVE Program Container", "references": [ { "url": "https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html" } ], "providerMetadata": { "orgId": "af854a3a-2127-422b-91ae-364da2661108", "shortName": "CVE", "dateUpdated": "2025-11-03T17:33:29.808Z" } } ] } }