Vulnerability in Kernel: usb: dwc3: gadget: Free gadget structure only after freeing endpoints

Kernel Updated 02 Oct 2025

Summary

31/05/2021
N/A
No i
Unrated
Not published

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 ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 →

Share this vulnerability

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.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback