{
  "id": "CVE-2025-38062",
  "url": "https://poc.griffinguard.io/cve/CVE-2025-38062",
  "published_at": "2025-06-18T09:33:41.282Z",
  "title": "genirq/msi: Store the IOMMU IOVA directly in msi_desc instead of iommu_cookie",
  "vendor": "Linux",
  "product": "Linux",
  "cvss": {
    "score": 7.8,
    "source": "cna",
    "vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "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.",
  "cpes": [
    "cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "cna": 7.8,
    "nvd": 5.5
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "\u003e= ece6e6f0218b7777e650bf93728130ae6f4feb7d, \u003c e4d3763223c7b72ded53425207075e7453b4e3d5",
          "\u003e= ece6e6f0218b7777e650bf93728130ae6f4feb7d, \u003c ba41e4e627db51d914444aee0b93eb67f31fa330",
          "\u003e= ece6e6f0218b7777e650bf93728130ae6f4feb7d, \u003c 53f42776e435f63e5f8e61955e4c205dbfeaf524",
          "\u003e= ece6e6f0218b7777e650bf93728130ae6f4feb7d, \u003c 856152eb91e67858a09e30a7149a1f29b04b7384",
          "\u003e= ece6e6f0218b7777e650bf93728130ae6f4feb7d, \u003c 1f7df3a691740a7736bbc99dc4ed536120eb4746"
        ],
        "fixed_in": [
          "e4d3763223c7b72ded53425207075e7453b4e3d5",
          "ba41e4e627db51d914444aee0b93eb67f31fa330",
          "53f42776e435f63e5f8e61955e4c205dbfeaf524",
          "856152eb91e67858a09e30a7149a1f29b04b7384",
          "1f7df3a691740a7736bbc99dc4ed536120eb4746"
        ]
      },
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "5.2"
        ],
        "fixed_in": [
          "0",
          "6.1.141",
          "6.6.93",
          "6.12.31",
          "6.14.9",
          "6.15"
        ]
      }
    ],
    "upgrade": [
      "Upgrade Linux to e4d3763223c7b72ded53425207075e7453b4e3d5 or ba41e4e627db51d914444aee0b93eb67f31fa330 or 53f42776e435f63e5f8e61955e4c205dbfeaf524 or 856152eb91e67858a09e30a7149a1f29b04b7384 or 1f7df3a691740a7736bbc99dc4ed536120eb4746 or later.",
      "Upgrade Linux to 0 or 6.1.141 or 6.6.93 or 6.12.31 or 6.14.9 or 6.15 or later."
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
