Skip to main content

CVE-2025-37843: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2025-37843cvecve-2025-37843
Published: Fri May 09 2025 (05/09/2025, 06:41:52 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

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 pci_lock_rescan_remove(), then waits for pciehp to unbind from a child hotplug port. Meanwhile that child hotplug port tries to acquire pci_lock_rescan_remove() as well in order to remove its own children. The deadlock only occurs if the parent acquires pci_lock_rescan_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 pci_get_dsn() 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 ->resume_noirq() 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 pci_dev_set_disconnected() and a child hotplug port can then reliably detect being removed.

AI-Powered Analysis

AILast updated: 07/04/2025, 00:14:17 UTC

Technical Analysis

CVE-2025-37843 is a vulnerability identified in the Linux kernel's PCI Express Hotplug (pciehp) subsystem. The issue arises from a race condition during the hot-removal of nested PCI hotplug ports, which can lead to a deadlock scenario. Specifically, when a parent hotplug port acquires the pci_lock_rescan_remove() lock and waits for the pciehp driver to unbind from a child hotplug port, the child port simultaneously attempts to acquire the same lock to remove its own children. This lock acquisition order dependency causes a deadlock only if the parent acquires the lock first. The vulnerability is exacerbated by a recent kernel commit (9d573d19547b) intended to detect device replacement during system sleep, which inadvertently increases the frequency of deadlocks when removing multiple Thunderbolt devices during sleep. The root cause is the inability to reliably differentiate between device removal and replacement because pci_get_dsn() returns zero in both cases. The proposed mitigation involves checking if the hotplug port itself was hot-removed and marking all children as removed using pci_dev_set_disconnected(), leveraging the top-down invocation order of the ->resume_noirq() callback to ensure reliable detection of removal. This fix avoids unnecessary device replacement checks and reduces deadlock occurrences. The vulnerability affects Linux kernel versions containing the specified commit and requires careful patching due to its intrusive nature. No known exploits are currently reported in the wild.

Potential Impact

For European organizations, this vulnerability primarily threatens systems running Linux kernels with the affected pciehp implementation, especially those utilizing nested PCI hotplug ports and Thunderbolt devices. The deadlock can cause system hangs or freezes during device removal, impacting system availability and potentially leading to operational disruptions. Critical infrastructure, data centers, and enterprise environments relying on hot-pluggable PCI devices for scalability or maintenance could experience downtime or degraded performance. While the vulnerability does not directly compromise confidentiality or integrity, the availability impact can be significant in environments requiring high uptime. Systems undergoing frequent device hot-removal, such as development workstations, servers with dynamic hardware configurations, or virtualized environments using PCI passthrough, are at higher risk. The issue is particularly relevant during system sleep states, which are common in energy-conscious European data centers and enterprises. The lack of known exploits reduces immediate risk, but the complexity and intrusiveness of the fix suggest that unpatched systems remain vulnerable to operational disruptions.

Mitigation Recommendations

European organizations should prioritize updating their Linux kernels to versions that include the fix for CVE-2025-37843 once officially released. Given the complexity of the fix, organizations should test kernel updates in controlled environments to ensure stability before wide deployment. In the interim, minimizing the use of nested PCI hotplug ports and avoiding hot-removal of multiple Thunderbolt devices during system sleep can reduce deadlock occurrences. System administrators should monitor system logs for signs of pci_lock_rescan_remove() deadlocks and implement alerting to detect hangs related to device removal. Where possible, scheduling device removal operations during active system states rather than sleep states can mitigate risk. Additionally, organizations should review their hardware configurations to limit nested hotplug scenarios and consider alternative hardware or configurations that do not rely on nested PCI hotplug ports. Collaboration with Linux distribution maintainers to receive timely patches and security advisories is also recommended.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-04-16T04:51:23.953Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9818c4522896dcbd7c61

Added to database: 5/21/2025, 9:08:40 AM

Last enriched: 7/4/2025, 12:14:17 AM

Last updated: 8/13/2025, 9:34:28 AM

Views: 10

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats