CVE-2024-42085
Linux Kernel USB DWC3 Lock Deadlock Vulnerability
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.
INFO
Published Date :
July 29, 2024, 5:15 p.m.
Last Modified :
Nov. 21, 2024, 9:33 a.m.
Source :
416baaa9-dc9f-4396-8d5f-8c081fb06d67
Remotely Exploitable :
No
Impact Score :
3.6
Exploitability Score :
1.8
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2024-42085
.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2024-42085
vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2024-42085
vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Modified by af854a3a-2127-422b-91ae-364da2661108
Nov. 21, 2024
Action Type Old Value New Value Added Reference https://git.kernel.org/stable/c/17e2956633ca560b95f1cbbb297cfc2adf650649 Added Reference https://git.kernel.org/stable/c/7026576e89094aa9a0062aa6d10cba18aa99944c Added Reference https://git.kernel.org/stable/c/7838de15bb700c2898a7d741db9b1f3cbc86c136 Added Reference https://git.kernel.org/stable/c/d77e2b5104c51d3668b9717c825a4a06998efe63 Added Reference https://git.kernel.org/stable/c/f1274cfab183e69a7c7bafffcb4f50703c876276 -
Initial Analysis by [email protected]
Aug. 26, 2024
Action Type Old Value New Value Added CVSS V3.1 NIST AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H Changed Reference Type https://git.kernel.org/stable/c/17e2956633ca560b95f1cbbb297cfc2adf650649 No Types Assigned https://git.kernel.org/stable/c/17e2956633ca560b95f1cbbb297cfc2adf650649 Patch Changed Reference Type https://git.kernel.org/stable/c/7026576e89094aa9a0062aa6d10cba18aa99944c No Types Assigned https://git.kernel.org/stable/c/7026576e89094aa9a0062aa6d10cba18aa99944c Patch Changed Reference Type https://git.kernel.org/stable/c/7838de15bb700c2898a7d741db9b1f3cbc86c136 No Types Assigned https://git.kernel.org/stable/c/7838de15bb700c2898a7d741db9b1f3cbc86c136 Patch Changed Reference Type https://git.kernel.org/stable/c/d77e2b5104c51d3668b9717c825a4a06998efe63 No Types Assigned https://git.kernel.org/stable/c/d77e2b5104c51d3668b9717c825a4a06998efe63 Patch Changed Reference Type https://git.kernel.org/stable/c/f1274cfab183e69a7c7bafffcb4f50703c876276 No Types Assigned https://git.kernel.org/stable/c/f1274cfab183e69a7c7bafffcb4f50703c876276 Patch Added CWE NIST CWE-667 Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.15.128 up to (excluding) 5.15.162 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.1 up to (excluding) 6.1.97 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.2 up to (excluding) 6.6.37 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.7 up to (excluding) 6.9.8 -
CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Jul. 29, 2024
Action Type Old Value New Value Added 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. Added Reference kernel.org https://git.kernel.org/stable/c/7026576e89094aa9a0062aa6d10cba18aa99944c [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/d77e2b5104c51d3668b9717c825a4a06998efe63 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/17e2956633ca560b95f1cbbb297cfc2adf650649 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/f1274cfab183e69a7c7bafffcb4f50703c876276 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/7838de15bb700c2898a7d741db9b1f3cbc86c136 [No types assigned]
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2024-42085
is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2024-42085
weaknesses.