CVE-2025-39958: iommu/s390: Make attach succeed when the device was surprise removed
In the Linux kernel, the following vulnerability has been resolved:
iommu/s390: Make attach succeed when the device was surprise removed
When a PCI device is removed with surprise hotplug, there may still be
attempts to attach the device to the default domain as part of tear down
via (__iommu_release_dma_ownership()), or because the removal happens
during probe (__iommu_probe_device()). In both cases zpci_register_ioat()
fails with a cc value indicating that the device handle is invalid. This
is because the device is no longer part of the instance as far as the
hypervisor is concerned.
Currently this leads to an error return and s390_iommu_attach_device()
fails. This triggers the WARN_ON() in __iommu_group_set_domain_nofail()
because attaching to the default domain must never fail.
With the device fenced by the hypervisor no DMAs to or from memory are
possible and the IOMMU translations have no effect. Proceed as if the
registration was successful and let the hotplug event handling clean up
the device.
This is similar to how devices in the error state are handled since
commit 59bbf596791b ("iommu/s390: Make attach succeed even if the device
is in error state") except that for removal the domain will not be
registered later. This approach was also previously discussed at the
link.
Handle both cases, error state and removal, in a helper which checks if
the error needs to be propagated or ignored. Avoid magic number
condition codes by using the pre-existing, but never used, defines for
PCI load/store condition codes and rename them to reflect that they
apply to all PCI instructions.
Security readout for executives and security teams
Plain-English summary
This Linux kernel issue affects a narrow IBM s390 PCI/IOMMU hotplug path. If a PCI device is unexpectedly removed, cleanup may fail and trigger a kernel warning in a path expected never to fail. The sources do not show data theft, privilege escalation, or active exploitation.
Executive priority
Treat this as a targeted platform reliability issue, not a broad emergency. Patch through normal kernel maintenance, with higher priority for s390 environments where PCI device hotplug or virtualization teardown failures affect uptime.
Technical view
On s390, surprise PCI hotplug removal can make zpci_register_ioat() return an invalid-handle condition during IOMMU default-domain attachment. s390_iommu_attach_device() then fails, reaching WARN_ON() in __iommu_group_set_domain_nofail(). The fix treats fenced, removed devices like non-DMA-capable cleanup cases and lets hotplug handling finish.
Likely exposure
Exposure appears limited to Linux systems using s390 PCI devices with IOMMU handling and surprise hotplug removal. The bundle lists Linux as affected, including 6.2, 6.16.9, and 6.17 entries, but exact version-range semantics are incomplete here.
Exploitation context
No KEV listing is present, and the provided sources do not claim active exploitation. The described condition depends on device removal timing during probe or DMA ownership release, making this primarily an availability or reliability concern based on the bundle.
Researcher notes
The source describes a resolved kernel logic flaw, but provides no CVSS, CWE, exploit evidence, or complete affected-range detail in this bundle. Analysis should stay tied to s390 IOMMU attach behavior and the two kernel stable references.
Mitigation direction
Review the referenced stable kernel commits and vendor kernel advisories.
Prioritize updates for IBM s390 systems using PCI passthrough, hotplug, or IOMMU features.
If no packaged fix is available, follow distribution kernel guidance.
Avoid assuming generic Linux fleet exposure without confirming s390 PCI usage.
Validation and detection
Inventory Linux kernels running on IBM s390 or related mainframe environments.
Check whether affected systems use PCI devices with IOMMU or hotplug paths.
Compare installed kernel builds against vendor advisories and referenced stable commits.
Review kernel logs for IOMMU attach failures or WARN_ON events during PCI removal.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2025-39958 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
0CVSS vectors
3Timeline events
0ADP providers
3Source links
Vulnerability timeline
Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.
CVE reservedCVE Program
The CVE ID was reserved by the assigning CNA.
CVE publishedCVE Program
The CVE record was published.
Oct 9, 2025, 09:47 UTC (UTC+00:00)
CVE updatedCVE Program
The CVE record metadata indicates this as the latest update time.