Skip to main content

CVE-2022-49371: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2022-49371cvecve-2022-49371
Published: Wed Feb 26 2025 (02/26/2025, 02:11:13 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: driver core: fix deadlock in __device_attach In __device_attach function, The lock holding logic is as follows: ... __device_attach device_lock(dev) // get lock dev async_schedule_dev(__device_attach_async_helper, dev); // func async_schedule_node async_schedule_node_domain(func) entry = kzalloc(sizeof(struct async_entry), GFP_ATOMIC); /* when fail or work limit, sync to execute func, but __device_attach_async_helper will get lock dev as well, which will lead to A-A deadlock. */ if (!entry || atomic_read(&entry_count) > MAX_WORK) { func; else queue_work_node(node, system_unbound_wq, &entry->work) device_unlock(dev) As shown above, when it is allowed to do async probes, because of out of memory or work limit, async work is not allowed, to do sync execute instead. it will lead to A-A deadlock because of __device_attach_async_helper getting lock dev. To fix the deadlock, move the async_schedule_dev outside device_lock, as we can see, in async_schedule_node_domain, the parameter of queue_work_node is system_unbound_wq, so it can accept concurrent operations. which will also not change the code logic, and will not lead to deadlock.

AI-Powered Analysis

AILast updated: 06/30/2025, 06:28:49 UTC

Technical Analysis

CVE-2022-49371 is a vulnerability identified in the Linux kernel's device driver core, specifically within the __device_attach function. The issue arises from a deadlock condition caused by improper lock handling during device attachment operations. The function __device_attach acquires a device lock (device_lock(dev)) and then attempts to schedule an asynchronous helper function (__device_attach_async_helper) using async_schedule_dev. Internally, async_schedule_dev calls async_schedule_node_domain, which queues work on the system_unbound_wq workqueue. However, if the allocation of the async work entry fails due to out-of-memory conditions or if the work queue is saturated (exceeding MAX_WORK), the code falls back to synchronous execution of the helper function while still holding the device lock. Since __device_attach_async_helper also attempts to acquire the same device lock, this fallback leads to an asynchronous-to-asynchronous (A-A) deadlock scenario. The fix involves moving the async_schedule_dev call outside the scope of the device_lock to prevent the deadlock. Because system_unbound_wq supports concurrent operations, this change does not alter the intended logic but ensures that the asynchronous helper function is scheduled without holding the device lock, thereby eliminating the deadlock risk. This vulnerability affects specific Linux kernel versions identified by the commit hash 765230b5f084863183aa8adb3405ab3f32c0b16e and was published on February 26, 2025. There are no known exploits in the wild at this time, and no CVSS score has been assigned.

Potential Impact

For European organizations, this vulnerability primarily poses a risk to systems running affected Linux kernel versions, especially those heavily reliant on device driver operations such as servers, embedded systems, and infrastructure devices. The deadlock can cause system hangs or degraded performance due to stalled device attachment processes, potentially leading to denial of service conditions. This can impact critical infrastructure, cloud service providers, and enterprises that depend on Linux-based environments for their operations. While the vulnerability does not directly lead to privilege escalation or data leakage, the availability impact can disrupt business continuity and operational reliability. Systems with high device churn or dynamic hardware changes are more susceptible to encountering this deadlock. Additionally, environments with constrained memory resources or high system load may be more prone to triggering the fallback synchronous execution path that causes the deadlock. Given the widespread use of Linux across European industries, including telecommunications, manufacturing, and public sector IT, the potential for operational disruption is significant if unpatched systems encounter this issue.

Mitigation Recommendations

European organizations should prioritize updating their Linux kernel to versions that include the fix for CVE-2022-49371. Specifically, applying the patch that moves the async_schedule_dev call outside the device_lock scope is critical. System administrators should audit their environments to identify devices running the affected kernel commit hashes and plan for timely kernel upgrades. In environments where immediate patching is not feasible, monitoring for symptoms of device attachment deadlocks, such as system hangs or unresponsive hardware initialization, can help in early detection. Additionally, organizations should ensure adequate system memory and avoid conditions that lead to work queue saturation to reduce the likelihood of fallback synchronous execution. For embedded or specialized Linux distributions, vendors should be engaged to provide patched kernel versions. Finally, implementing robust system monitoring and alerting for kernel-level deadlocks or device driver failures will aid in rapid incident response.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-02-26T02:08:31.555Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d982dc4522896dcbe5800

Added to database: 5/21/2025, 9:09:01 AM

Last enriched: 6/30/2025, 6:28:49 AM

Last updated: 7/26/2025, 10:40:13 PM

Views: 8

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