Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C81A126E6FD for ; Thu, 9 Oct 2025 09:48:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760003281; cv=none; b=JNxs2pH9LGaCP6kiZPYG7AmWBTHGxgAGb1n+F0WKeeCAx+oxkREmfuJxkFLCPiDnn1oiP1ok9y3gmeSakJx3Rht5SNEQXV7m8Erd/2OrnsQebMg/ot4dkIP6AHTdp/Fhzx4Jk90HUft9Xb9mwrRdkE2Ohd0Ckk8tHMZlNmzc/SM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760003281; c=relaxed/simple; bh=RLYuiEi79/qv6yRJ+RURYwVfisb1OhJOfDS7q+1Oa6Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NjsAsSmxz6oy3K8A6IVt1zQWrqmA2Y2A3cO8GQVdObp0oKznTRvjcaMz6BQpEpCTlDgoRpGKzze7Cy59wdTSrY0AA2A0YVrFOmdbWhv7awUdg7chvrdV9Zrnk34tza91DC+HdmDwCmlFGOkB8YQO2bFy/WoP7u2NNS8YTeZSTnc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NNXy7kUb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NNXy7kUb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D735C4CEF9; Thu, 9 Oct 2025 09:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1760003281; bh=RLYuiEi79/qv6yRJ+RURYwVfisb1OhJOfDS7q+1Oa6Y=; h=From:To:Cc:Subject:Date:Reply-to:From; b=NNXy7kUbxTKxXSyydgQfOIglnP3yQ4HQRl5S0W89volah0Wdk0Hcjk2uhZLFFxyw0 QuRNI+LImSUB9Ix0F3EyeeTPDP2DUd+D5AK4D7VPEGx7jpvjT2//Wj6Dlr4xIWrLLa veFf/TzEocAeYIQ5HsW6j39TUjFmq3hidDAqh2w4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39958: iommu/s390: Make attach succeed when the device was surprise removed Date: Thu, 9 Oct 2025 11:47:44 +0200 Message-ID: <2025100943-CVE-2025-39958-6e96@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3149; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=7J2X1vfCYVEFZ5z8bYa8zAIw1N3gSnoP031h5KabflY=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnPW/bfsjhVJRf2VXauUlLg25AJXMG6UTm6lzRiRHNfh 33/ZDetI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACYy+x3DLOYZnVbrre6FzF2m rRo7e1/kq+5uN4Y5nLbB054taVrz2cPV+4G81n+13XefAAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman 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. The Linux kernel CVE team has assigned CVE-2025-39958 to this issue. Affected and fixed versions =========================== Fixed in 6.16.9 with commit 359613f2fa009587154511e4842e8ab9532edd15 Fixed in 6.17 with commit 9ffaf5229055fcfbb3b3d6f1c7e58d63715c3f73 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2025-39958 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: arch/s390/include/asm/pci_insn.h drivers/iommu/s390-iommu.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/359613f2fa009587154511e4842e8ab9532edd15 https://git.kernel.org/stable/c/9ffaf5229055fcfbb3b3d6f1c7e58d63715c3f73