Vulnerability in Kernel package: usb: dwc3: gadget

Kernel Updated 02 Oct 2025

Summary

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

GSD-2021-1000199: usb: dwc3: gadget: Free gadget structure only after freeing endpoints. Affects Kernel versions >= e81a7018d93a7de31a3f121c9a7eecd0a5ec58b0, < b4b8e9601d7ee8806d2687f081a42485d27674a1. 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 Penetration testing for web, API and mobile 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 package is an essential component of the Linux operating system, responsible for managing the system's core functionality. It provides various services and drivers to facilitate communication between hardware and software. The usb: dwc3: gadget module within the Kernel package enables the system to act as a USB gadget, allowing it to function as a peripheral device when connected to a host system. However, a vulnerability has been identified in this module that could potentially be exploited by attackers.

Vulnerability Detail

The vulnerability in the usb: dwc3: gadget module arises from a flaw in the freeing process of the gadget structure. Specifically, the gadget structure is freed before freeing the associated endpoints, which can lead to use-after-free issues. An attacker could potentially exploit this vulnerability 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 the Linux Kernel version v5.12.5.

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 apply the patch manually to their existing Kernel version. Here is an example of how to apply the patch:

  1. Download the patch file from the official Linux Kernel repository.
  2. Navigate to the Kernel source code directory.
  3. Apply the patch using the 'patch' command:

$ patch -p1 < path/to/patch/file

  1. Recompile and reinstall the Kernel.

Please note that applying patches manually can be complex and error-prone. It is recommended to update to the latest Kernel version whenever possible.

Conclusion

In conclusion, a vulnerability has been identified in the usb: dwc3: gadget module of the Kernel package. This vulnerability can potentially be exploited to execute arbitrary code or cause a denial-of-service condition. It is crucial to update the Linux Kernel package to version v5.12.5 or later to mitigate this vulnerability. For further support and assistance with vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for Kernel →

Share this vulnerability

FAQ

The Kernel package is a crucial component of the Linux operating system, responsible for managing core system functionality and facilitating communication between hardware and software.

The usb: dwc3: gadget module is a part of the Kernel package that enables the system to function as a USB gadget, allowing it to act as a peripheral device when connected to a host system.

The impact of this vulnerability is not yet proven. However, if successfully exploited, an attacker could execute arbitrary code or cause a denial-of-service condition.

To fix this vulnerability, it is recommended to update the Linux Kernel package to version v5.12.5 or later. This update includes the necessary patch to address the flaw in the usb: dwc3: gadget module.

Yes, users can manually apply the patch to their existing Kernel version. However, it is recommended to update to the latest Kernel version whenever possible.

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