CVE-2025-39958
Full vulnerability record from the local CVENow database.
Description
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.
View original CVE JSON
{
"id": "CVE-2025-39958",
"sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"published": "2025-10-09T10:15:37.867",
"lastModified": "2026-10-21T13:18:17.850",
"vulnStatus": "Modified",
"cveTags": [],
"descriptions": [
{
"lang": "en",
"value": "In the Linux kernel, the following vulnerability has been resolved:\n\niommu/s390: Make attach succeed when the device was surprise removed\n\nWhen a PCI device is removed with surprise hotplug, there may still be\nattempts to attach the device to the default domain as part of tear down\nvia (__iommu_release_dma_ownership()), or because the removal happens\nduring probe (__iommu_probe_device()). In both cases zpci_register_ioat()\nfails with a cc value indicating that the device handle is invalid. This\nis because the device is no longer part of the instance as far as the\nhypervisor is concerned.\n\nCurrently this leads to an error return and s390_iommu_attach_device()\nfails. This triggers the WARN_ON() in __iommu_group_set_domain_nofail()\nbecause attaching to the default domain must never fail.\n\nWith the device fenced by the hypervisor no DMAs to or from memory are\npossible and the IOMMU translations have no effect. Proceed as if the\nregistration was successful and let the hotplug event handling clean up\nthe device.\n\nThis is similar to how devices in the error state are handled since\ncommit 59bbf596791b (\"iommu/s390: Make attach succeed even if the device\nis in error state\") except that for removal the domain will not be\nregistered later. This approach was also previously discussed at the\nlink.\n\nHandle both cases, error state and removal, in a helper which checks if\nthe error needs to be propagated or ignored. Avoid magic number\ncondition codes by using the pre-existing, but never used, defines for\nPCI load/store condition codes and rename them to reflect that they\napply to all PCI instructions."
},
{
"lang": "es",
"value": "En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\niommu/s390: Hacer que la conexión tenga éxito cuando el dispositivo fue eliminado inesperadamente\n\nCuando un dispositivo PCI es eliminado con hotplug por sorpresa, todavía puede haber intentos de conectar el dispositivo al dominio predeterminado como parte del desmantelamiento a través de (__iommu_release_dma_ownership()), o porque la eliminación ocurre durante la sonda (__iommu_probe_device()). En ambos casos, zpci_register_ioat() falla con un valor cc que indica que el identificador del dispositivo es inválido. Esto se debe a que el dispositivo ya no forma parte de la instancia en lo que respecta al hipervisor.\n\nActualmente esto lleva a un retorno de error y s390_iommu_attach_device() falla. Esto activa el WARN_ON() en __iommu_group_set_domain_nofail() porque la conexión al dominio predeterminado nunca debe fallar.\n\nCon el dispositivo cercado por el hipervisor, no son posibles DMAs hacia o desde la memoria y las traducciones IOMMU no tienen efecto. Proceder como si el registro hubiera sido exitoso y dejar que el manejo del evento hotplug limpie el dispositivo.\n\nEsto es similar a cómo se manejan los dispositivos en estado de error desde el commit 59bbf596791b ('iommu/s390: Hacer que la conexión tenga éxito incluso si el dispositivo está en estado de error') excepto que para la eliminación el dominio no será registrado más tarde. Este enfoque también fue discutido previamente en el enlace.\n\nManejar ambos casos, estado de error y eliminación, en una función auxiliar que verifica si el error necesita ser propagado o ignorado. Evitar códigos de condición de números mágicos utilizando las definiciones preexistentes, pero nunca usadas, para los códigos de condición de carga/almacenamiento PCI y renombrarlas para reflejar que se aplican a todas las instrucciones PCI."
}
],
"affected": [
{
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"affectedData": [
{
"vendor": "Linux",
"product": "Linux",
"defaultStatus": "unaffected",
"programFiles": [
"arch/s390/include/asm/pci_insn.h",
"drivers/iommu/s390-iommu.c"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"versions": [
{
"version": "59bbf596791b89c7f88fdcac29dfc39c1221d25d",
"lessThan": "3b32cf6e279597d1b6477fb89d46abf65263c139",
"versionType": "git",
"status": "affected"
},
{
"version": "59bbf596791b89c7f88fdcac29dfc39c1221d25d",
"lessThan": "79fa3a19aa6114189b33e2ba1f393b0f635d7544",
"versionType": "git",
"status": "affected"
},
{
"version": "59bbf596791b89c7f88fdcac29dfc39c1221d25d",
"lessThan": "359613f2fa009587154511e4842e8ab9532edd15",
"versionType": "git",
"status": "affected"
},
{
"version": "59bbf596791b89c7f88fdcac29dfc39c1221d25d",
"lessThan": "9ffaf5229055fcfbb3b3d6f1c7e58d63715c3f73",
"versionType": "git",
"status": "affected"
}
]
},
{
"vendor": "Linux",
"product": "Linux",
"defaultStatus": "affected",
"programFiles": [
"arch/s390/include/asm/pci_insn.h",
"drivers/iommu/s390-iommu.c"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"versions": [
{
"version": "6.2",
"status": "affected"
},
{
"version": "0",
"lessThan": "6.2",
"versionType": "semver",
"status": "unaffected"
},
{
"version": "6.6.160",
"lessThanOrEqual": "6.6.*",
"versionType": "semver",
"status": "unaffected"
},
{
"version": "6.12.114",
"lessThanOrEqual": "6.12.*",
"versionType": "semver",
"status": "unaffected"
},
{
"version": "6.16.9",
"lessThanOrEqual": "6.16.*",
"versionType": "semver",
"status": "unaffected"
},
{
"version": "6.17",
"lessThanOrEqual": "*",
"versionType": "original_commit_for_fix",
"status": "unaffected"
}
]
}
]
}
],
"metrics": {
"cvssMetricV31": [
{
"source": "[email protected]",
"type": "Primary",
"cvssData": {
"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",
"attackVector": "LOCAL",
"attackComplexity": "LOW",
"privilegesRequired": "LOW",
"userInteraction": "NONE",
"scope": "UNCHANGED",
"confidentialityImpact": "HIGH",
"integrityImpact": "HIGH",
"availabilityImpact": "HIGH"
},
"exploitabilityScore": 1.8,
"impactScore": 5.9
}
]
},
"weaknesses": [
{
"source": "[email protected]",
"type": "Primary",
"description": [
{
"lang": "en",
"value": "NVD-CWE-noinfo"
}
]
}
],
"configurations": [
{
"nodes": [
{
"operator": "OR",
"negate": false,
"cpeMatch": [
{
"vulnerable": true,
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionStartIncluding": "6.2",
"versionEndExcluding": "6.16.9",
"matchCriteriaId": "AB8B7AE8-C232-4C69-8B7C-F9AD496F08F5"
},
{
"vulnerable": true,
"criteria": "cpe:2.3:o:linux:linux_kernel:6.17:rc1:*:*:*:*:*:*",
"matchCriteriaId": "327D22EF-390B-454C-BD31-2ED23C998A1C"
},
{
"vulnerable": true,
"criteria": "cpe:2.3:o:linux:linux_kernel:6.17:rc2:*:*:*:*:*:*",
"matchCriteriaId": "C730CD9A-D969-4A8E-9522-162AAF7C0EE9"
},
{
"vulnerable": true,
"criteria": "cpe:2.3:o:linux:linux_kernel:6.17:rc3:*:*:*:*:*:*",
"matchCriteriaId": "39982C4B-716E-4B2F-8196-FA301F47807D"
},
{
"vulnerable": true,
"criteria": "cpe:2.3:o:linux:linux_kernel:6.17:rc4:*:*:*:*:*:*",
"matchCriteriaId": "340BEEA9-D70D-4290-B502-FBB1032353B1"
},
{
"vulnerable": true,
"criteria": "cpe:2.3:o:linux:linux_kernel:6.17:rc5:*:*:*:*:*:*",
"matchCriteriaId": "47E4C5C0-079F-4838-971B-8C503D48FCC2"
},
{
"vulnerable": true,
"criteria": "cpe:2.3:o:linux:linux_kernel:6.17:rc6:*:*:*:*:*:*",
"matchCriteriaId": "5A4516A6-C12E-42A4-8C0E-68AEF3264504"
}
]
}
]
}
],
"references": [
{
"url": "https://git.kernel.org/stable/c/359613f2fa009587154511e4842e8ab9532edd15",
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"tags": [
"Patch"
]
},
{
"url": "https://git.kernel.org/stable/c/3b32cf6e279597d1b6477fb89d46abf65263c139",
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
},
{
"url": "https://git.kernel.org/stable/c/79fa3a19aa6114189b33e2ba1f393b0f635d7544",
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
},
{
"url": "https://git.kernel.org/stable/c/9ffaf5229055fcfbb3b3d6f1c7e58d63715c3f73",
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"tags": [
"Patch"
]
}
]
}