
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2022-49398 is a vulnerability in the Linux kernel's USB DWC3 gadget driver that was discovered and resolved in 2022. The issue involves improper handling of list traversal when using the list_for_each_entry_safe() macro in conjunction with gadget giveback operations (Kernel Git).
The vulnerability stems from the list_for_each_entry_safe() macro's behavior, which saves the current item (n) and the next item (n+1) for safe list traversal. When traversing the list and removing items using gadget giveback, the DWC3 lock is briefly released, allowing other routines to execute. This creates a race condition where the cancelled_list can be modified by parallel operations, specifically during the interaction between dwc3_gadget_ep_cleanup_cancelled_requests() and the pullup disable routine (Kernel Git).
When the vulnerability is triggered, it can lead to a kernel panic when list debugging is enabled. This occurs because the cleanup routine removes item n while the pullup disable removes item n+1, resulting in the cleanup routine attempting to reference an already removed/handled request after retaking the DWC3 lock (Kernel Git).
The issue has been fixed by replacing the list_for_each_entry_safe() macro usage with a while loop that checks for empty lists and handles endpoint disabled conditions appropriately. The fix ensures proper cleanup of requests and prevents the race condition that could lead to kernel panics (Kernel Git).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."