CVE-2025-37843

Source
https://nvd.nist.gov/vuln/detail/CVE-2025-37843
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-37843.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2025-37843
Downstream
Published
2025-05-09T06:41:52Z
Modified
2025-10-16T00:52:35.008740Z
Summary
PCI: pciehp: Avoid unnecessary device replacement check
Details

In the Linux kernel, the following vulnerability has been resolved:

PCI: pciehp: Avoid unnecessary device replacement check

Hot-removal of nested PCI hotplug ports suffers from a long-standing race condition which can lead to a deadlock: A parent hotplug port acquires pcilockrescanremove(), then waits for pciehp to unbind from a child hotplug port. Meanwhile that child hotplug port tries to acquire pcilockrescanremove() as well in order to remove its own children.

The deadlock only occurs if the parent acquires pcilockrescan_remove() first, not if the child happens to acquire it first.

Several workarounds to avoid the issue have been proposed and discarded over the years, e.g.:

https://lore.kernel.org/r/4c882e25194ba8282b78fe963fec8faae7cf23eb.1529173804.git.lukas@wunner.de/

A proper fix is being worked on, but needs more time as it is nontrivial and necessarily intrusive.

Recent commit 9d573d19547b ("PCI: pciehp: Detect device replacement during system sleep") provokes more frequent occurrence of the deadlock when removing more than one Thunderbolt device during system sleep. The commit sought to detect device replacement, but also triggered on device removal. Differentiating reliably between replacement and removal is impossible because pcigetdsn() returns 0 both if the device was removed, as well as if it was replaced with one lacking a Device Serial Number.

Avoid the more frequent occurrence of the deadlock by checking whether the hotplug port itself was hot-removed. If so, there's no sense in checking whether its child device was replaced.

This works because the ->resumenoirq() callback is invoked in top-down order for the entire hierarchy: A parent hotplug port detecting device replacement (or removal) marks all children as removed using pcidevsetdisconnected() and a child hotplug port can then reliably detect being removed.

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
9d573d19547b3fae0c1d4e5fce52bdad3fda3664
Fixed
e4a1d7defbc2d806540720a5adebe24ec3488683
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
9d573d19547b3fae0c1d4e5fce52bdad3fda3664
Fixed
0d0bbd01f7c0ac7d1be9f85aaf2cd0baec34655f
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
9d573d19547b3fae0c1d4e5fce52bdad3fda3664
Fixed
7535d10a2c61baeff493300070cf04d9ddda216b
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
9d573d19547b3fae0c1d4e5fce52bdad3fda3664
Fixed
e3260237aaadc9799107ccb940c6688195c4518d

Affected versions

v6.*

v6.10
v6.10-rc2
v6.10-rc3
v6.10-rc4
v6.10-rc5
v6.10-rc6
v6.10-rc7
v6.11
v6.11-rc1
v6.11-rc2
v6.11-rc3
v6.11-rc4
v6.11-rc5
v6.11-rc6
v6.11-rc7
v6.12
v6.12-rc1
v6.12-rc2
v6.12-rc3
v6.12-rc4
v6.12-rc5
v6.12-rc6
v6.12-rc7
v6.12.1
v6.12.10
v6.12.11
v6.12.12
v6.12.13
v6.12.14
v6.12.15
v6.12.16
v6.12.17
v6.12.18
v6.12.19
v6.12.2
v6.12.20
v6.12.21
v6.12.22
v6.12.23
v6.12.3
v6.12.4
v6.12.5
v6.12.6
v6.12.7
v6.12.8
v6.12.9
v6.13
v6.13-rc1
v6.13-rc2
v6.13-rc3
v6.13-rc4
v6.13-rc5
v6.13-rc6
v6.13-rc7
v6.13.1
v6.13.10
v6.13.11
v6.13.2
v6.13.3
v6.13.4
v6.13.5
v6.13.6
v6.13.7
v6.13.8
v6.13.9
v6.14
v6.14-rc1
v6.14-rc2
v6.14-rc3
v6.14-rc4
v6.14-rc5
v6.14-rc6
v6.14-rc7
v6.14.1
v6.14.2

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.11.0
Fixed
6.12.24
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.13.12
Type
ECOSYSTEM
Events
Introduced
6.14.0
Fixed
6.14.3