Skip to main content

CVE-2024-42085: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2024-42085cvecve-2024-42085
Published: Mon Jul 29 2024 (07/29/2024, 16:26:26 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: usb: dwc3: core: remove lock of otg mode during gadget suspend/resume to avoid deadlock When config CONFIG_USB_DWC3_DUAL_ROLE is selected, and trigger system to enter suspend status with below command: echo mem > /sys/power/state There will be a deadlock issue occurring. Detailed invoking path as below: dwc3_suspend_common() spin_lock_irqsave(&dwc->lock, flags); <-- 1st dwc3_gadget_suspend(dwc); dwc3_gadget_soft_disconnect(dwc); spin_lock_irqsave(&dwc->lock, flags); <-- 2nd This issue is exposed by commit c7ebd8149ee5 ("usb: dwc3: gadget: Fix NULL pointer dereference in dwc3_gadget_suspend") that removes the code of checking whether dwc->gadget_driver is NULL or not. It causes the following code is executed and deadlock occurs when trying to get the spinlock. In fact, the root cause is the commit 5265397f9442("usb: dwc3: Remove DWC3 locking during gadget suspend/resume") that forgot to remove the lock of otg mode. So, remove the redundant lock of otg mode during gadget suspend/resume.

AI-Powered Analysis

AILast updated: 06/29/2025, 04:56:55 UTC

Technical Analysis

CVE-2024-42085 is a vulnerability in the Linux kernel's USB subsystem, specifically within the DesignWare Core USB3 (dwc3) driver when configured with CONFIG_USB_DWC3_DUAL_ROLE. The issue arises during system suspend/resume operations triggered by echoing 'mem' to /sys/power/state, which causes the system to enter suspend mode. The vulnerability is a deadlock condition caused by improper locking behavior in the dwc3 driver. The root cause stems from a previous commit (5265397f9442) that removed locking during gadget suspend/resume but failed to remove the lock related to OTG (On-The-Go) mode. This results in nested spinlock acquisitions on the same lock (dwc->lock) within the suspend path: dwc3_suspend_common() acquires the lock first, then dwc3_gadget_suspend() calls dwc3_gadget_soft_disconnect(), which attempts to acquire the same lock again, causing a deadlock. The deadlock prevents the system from properly suspending or resuming USB gadget functionality, potentially freezing the system or causing USB device malfunction. This vulnerability was introduced by a commit that removed a NULL pointer check on dwc->gadget_driver, which exposed the deadlock scenario. The fix involves removing the redundant OTG mode lock during gadget suspend/resume to prevent the deadlock. This vulnerability affects Linux kernel versions containing the specified commits and configurations enabling dual-role USB functionality in the dwc3 driver. No known exploits are reported in the wild as of now.

Potential Impact

For European organizations, this vulnerability primarily impacts systems running Linux kernels with the affected dwc3 USB driver configuration, especially embedded devices, IoT devices, or servers using USB dual-role functionality. The deadlock can cause system hangs or failures during suspend/resume cycles, leading to availability issues. This can disrupt critical operations in environments relying on USB devices for connectivity or data transfer, such as industrial control systems, telecommunications infrastructure, or enterprise servers. Organizations using Linux-based devices in mobile or power-saving modes may experience increased system instability or downtime. Although the vulnerability does not directly expose confidentiality or integrity risks, the availability impact can be significant, especially in environments requiring high uptime or remote management. The lack of known exploits reduces immediate risk, but the vulnerability could be leveraged in targeted attacks to cause denial of service or disrupt device operations.

Mitigation Recommendations

To mitigate this vulnerability, European organizations should: 1) Apply the official Linux kernel patches that remove the redundant OTG mode lock during gadget suspend/resume as soon as they become available from trusted sources or Linux distributions. 2) Review and audit kernel configurations to identify systems using CONFIG_USB_DWC3_DUAL_ROLE and assess their exposure. 3) For embedded or IoT devices, coordinate with device vendors to ensure firmware/kernel updates include the fix. 4) Temporarily disable USB dual-role functionality if feasible to avoid triggering the deadlock during suspend/resume cycles. 5) Implement monitoring for system hangs or USB subsystem failures that could indicate deadlock conditions. 6) Test suspend/resume operations in controlled environments after patching to confirm resolution. 7) Maintain up-to-date backups and recovery procedures to minimize downtime impact in case of system hangs. These steps go beyond generic advice by focusing on configuration auditing, vendor coordination, and operational monitoring specific to the affected USB subsystem.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-07-29T15:50:41.170Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9827c4522896dcbe19ec

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

Last enriched: 6/29/2025, 4:56:55 AM

Last updated: 7/28/2025, 1:29:39 PM

Views: 12

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