Vulnerability in Kernel: usb: dwc3: gadget: Free gadget structure only after freeing endpoints
Summary
GSD-2021-1000318: usb: dwc3: gadget: Free gadget structure only after freeing endpoints. Affects Kernel versions >= e81a7018d93a7de31a3f121c9a7eecd0a5ec58b0, < 1ea775021282d90e1d08d696b7ab54aa75d688e5. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The Kernel is a fundamental component of the Linux operating system, responsible for managing system resources and facilitating communication between hardware and software. It provides essential functionalities for the proper functioning of the system. One of the components within the Kernel is the usb-dwc3-gadget module, which handles USB gadget functionality. This module allows the system to act as a USB device when connected to a host. The vulnerability identified in this module relates to the improper freeing of the gadget structure without first freeing the associated endpoints.
Vulnerability Detail
The vulnerability arises from a flaw in the usb-dwc3-gadget module, where the gadget structure is freed before freeing the endpoints. This can lead to use-after-free vulnerabilities, where an attacker could potentially exploit the freed memory to execute arbitrary code or cause a denial-of-service condition. The impact and attack plausibility of this vulnerability have not been proven yet. It is important to note that this vulnerability has been fixed in Linux Kernel version v5.10.38 by commit 1ea775021282d90e1d08d696b7ab54aa75d688e5. The vulnerability was introduced in version v5.10 by commit e81a7018d93a7de31a3f121c9a7eecd0a5ec58b0.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a workaround, users can disable the usb-dwc3-gadget module if it is not required for their system. This can be done by blacklisting the module or preventing it from loading during system startup. However, this workaround should only be considered if the module is not essential for the system's functionality.
Conclusion
In conclusion, the vulnerability in the usb-dwc3-gadget module of the Kernel can lead to use-after-free vulnerabilities. It is crucial to update the Kernel to version v5.10.38 or later to mitigate this issue. Alternatively, users can consider disabling the module if it is not necessary for their system. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The Kernel is a fundamental component of the Linux operating system, responsible for managing system resources and facilitating communication between hardware and software.
The usb-dwc3-gadget module is a component within the Kernel that handles USB gadget functionality. It allows the system to act as a USB device when connected to a host.
A use-after-free vulnerability occurs when a program continues to use memory after it has been freed. This can lead to various security issues, including the potential execution of arbitrary code or denial-of-service attacks.
To fix this vulnerability, it is recommended to update the Linux Kernel to version v5.10.38 or later. Alternatively, you can wait for your Linux distribution to release an updated package containing the fixed version of the Kernel.
Yes, as a workaround, you can disable the usb-dwc3-gadget module if it is not required for your system. This can be done by blacklisting the module or preventing it from loading during system startup.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.