Use-After-Free Vulnerability in Linux Kernel's GadgetFS Driver

linux Updated 02 Oct 2025

Summary

21/08/2024
N/A
Yes i
Medium
4.7

CVE-2022-48869: In the Linux kernel, the following vulnerability has been resolved: USB: gadgetfs: Fix race between mounting and unmounting The syzbot fuzzer and Gerald Lee have identified a use-after-free bug in the gadgetfs driver, in... Affects linux versions < 5.10.178-1. Fixed in 5.10.178-1. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The Linux kernel is a core component of many operating systems, providing essential services for hardware management and system resources. The GadgetFS driver allows user-space applications to interact with USB devices, enabling functionalities like device emulation. However, it is susceptible to a race condition that can lead to a use-after-free vulnerability, potentially compromising system stability and security.

Vulnerability Detail

The vulnerability identified as CVE-2022-48869 arises from a race condition between the mounting and unmounting processes of the GadgetFS filesystem. Specifically, the functions gadgetfs_fill_super() and gadgetfs_kill_sb() can operate concurrently, leading to a scenario where the device is deallocated while still in use. This can result in a use-after-free error, which may allow an attacker to exploit the system, leading to data corruption or unauthorized access. The issue was highlighted by the syzbot fuzzer and involves critical components of the Linux kernel's memory management.

How To Fix

Minimum fixed version

5.10.178-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade linux

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can avoid mounting the GadgetFS filesystem while it is being unmounted. This can be achieved by ensuring that no processes are accessing the filesystem during unmounting. However, this is not a permanent solution and updating the kernel is strongly recommended.

Conclusion

CVE-2022-48869 is a significant vulnerability in the Linux kernel's GadgetFS driver that can lead to serious security issues if not addressed. It is crucial for users to update their systems to the latest kernel versions to mitigate the risks associated with this vulnerability. Utilizing tools like Vulert can help in monitoring and managing open-source vulnerabilities effectively.

See every vulnerability recorded for linux →

Share this vulnerability

FAQ

CVE-2022-48869 is a vulnerability in the Linux kernel's GadgetFS driver that can lead to a use-after-free error due to a race condition between mounting and unmounting the filesystem.

Exploitation of this vulnerability could lead to system instability, data corruption, or unauthorized access to system resources.

You can use the Vulert platform to monitor and alert for open-source vulnerabilities in your software. Simply upload your manifest file like package-lock.json to check for vulnerabilities.

The vulnerability affects various versions of the Linux kernel prior to the fixed versions: 5.10.178-1 for Debian 11, and 6.1.8-1 for Debian 12 and 13.

The CVSS score for CVE-2022-48869 is 4.7, indicating a moderate level of severity.

Related vulnerabilities

Recent vulnerabilities recorded for linux.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

5.10.178-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade linux

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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