Use-After-Free Vulnerability in Linux Kernel's GadgetFS Driver
Summary
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 ↓
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 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 →
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.