# CVE-2022-48869: USB: gadgetfs: Fix race between mounting and unmounting

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 4.7
- **CVSS:** 4.7 (v3.1, NVD) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.28% (percentile 13, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-08-21T06:09:59.526Z
- **Modified:** 2026-06-17T05:16:25.670Z

## Who should check

- Anyone running Linux \>= e5d82a7360d124ae1a38c2a5eac92ba49b125191, \< 9a39f4626b361ee7aa10fd990401c37ec3b466ae; \>= e5d82a7360d124ae1a38c2a5eac92ba49b125191, \< 856e4b5e53f21edbd15d275dde62228dd94fb2b4; \>= e5d82a7360d124ae1a38c2a5eac92ba49b125191, \< a2e075f40122d8daf587db126c562a67abd69cf9; \>= e5d82a7360d124ae1a38c2a5eac92ba49b125191, \< 616fd34d017000ecf9097368b13d8a266f4920b3; \>= e5d82a7360d124ae1a38c2a5eac92ba49b125191, \< d18dcfe9860e842f394e37ba01ca9440ab2178f4
- Anyone running Linux 5.3

## Description

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, involving processes concurrently mounting and
unmounting the gadgetfs filesystem.  In particular, gadgetfs\_fill\_super()
can race with gadgetfs\_kill\_sb(), causing the latter to deallocate
the\_device while the former is using it.  The output from KASAN says,
in part:

BUG: KASAN: use-after-free in instrument\_atomic\_read\_write include/linux/instrumented.h:102 \[inline\]
BUG: KASAN: use-after-free in atomic\_fetch\_sub\_release include/linux/atomic/atomic-instrumented.h:176 \[inline\]
BUG: KASAN: use-after-free in \_\_refcount\_sub\_and\_test include/linux/refcount.h:272 \[inline\]
BUG: KASAN: use-after-free in \_\_refcount\_dec\_and\_test include/linux/refcount.h:315 \[inline\]
BUG: KASAN: use-after-free in refcount\_dec\_and\_test include/linux/refcount.h:333 \[inline\]
BUG: KASAN: use-after-free in put\_dev drivers/usb/gadget/legacy/inode.c:159 \[inline\]
BUG: KASAN: use-after-free in gadgetfs\_kill\_sb+0x33/0x100 drivers/usb/gadget/legacy/inode.c:2086
Write of size 4 at addr ffff8880276d7840 by task syz-executor126/18689

CPU: 0 PID: 18689 Comm: syz-executor126 Not tainted 6.1.0-syzkaller \#0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 \<TASK\>
...
 atomic\_fetch\_sub\_release include/linux/atomic/atomic-instrumented.h:176 \[inline\]
 \_\_refcount\_sub\_and\_test include/linux/refcount.h:272 \[inline\]
 \_\_refcount\_dec\_and\_test include/linux/refcount.h:315 \[inline\]
 refcount\_dec\_and\_test include/linux/refcount.h:333 \[inline\]
 put\_dev drivers/usb/gadget/legacy/inode.c:159 \[inline\]
 gadgetfs\_kill\_sb+0x33/0x100 drivers/usb/gadget/legacy/inode.c:2086
 deactivate\_locked\_super+0xa7/0xf0 fs/super.c:332
 vfs\_get\_super fs/super.c:1190 \[inline\]
 get\_tree\_single+0xd0/0x160 fs/super.c:1207
 vfs\_get\_tree+0x88/0x270 fs/super.c:1531
 vfs\_fsconfig\_locked fs/fsopen.c:232 \[inline\]

The simplest solution is to ensure that gadgetfs\_fill\_super() and
gadgetfs\_kill\_sb() are serialized by making them both acquire a new
mutex.

## Affected and fixed versions

- Linux: \>= e5d82a7360d124ae1a38c2a5eac92ba49b125191, \< 9a39f4626b361ee7aa10fd990401c37ec3b466ae; \>= e5d82a7360d124ae1a38c2a5eac92ba49b125191, \< 856e4b5e53f21edbd15d275dde62228dd94fb2b4; \>= e5d82a7360d124ae1a38c2a5eac92ba49b125191, \< a2e075f40122d8daf587db126c562a67abd69cf9; \>= e5d82a7360d124ae1a38c2a5eac92ba49b125191, \< 616fd34d017000ecf9097368b13d8a266f4920b3; \>= e5d82a7360d124ae1a38c2a5eac92ba49b125191, \< d18dcfe9860e842f394e37ba01ca9440ab2178f4 (cvelist)
- Linux: 5.3 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-48869. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-48869.md
Affected: Linux >= e5d82a7360d124ae1a38c2a5eac92ba49b125191, < 9a39f4626b361ee7aa10fd990401c37ec3b466ae; >= e5d82a7360d124ae1a38c2a5eac92ba49b125191, < 856e4b5e53f21edbd15d275dde62228dd94fb2b4; >= e5d82a7360d124ae1a38c2a5eac92ba49b125191, < a2e075f40122d8daf587db126c562a67abd69cf9; >= e5d82a7360d124ae1a38c2a…
Fixed in: Linux 9a39f4626b361ee7aa10fd990401c37ec3b466ae, Linux 856e4b5e53f21edbd15d275dde62228dd94fb2b4, Linux 616fd34d017000ecf9097368b13d8a266f4920b3

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-48869 being exploited?

There is no confirmed exploitation: CVE-2022-48869 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.28% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-48869?

Medium: CVSS 4.7 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2022-48869?

Linux \>= e5d82a7360d124ae1a38c2a5eac92ba49b125191, \< 9a39f4626b361ee7aa10fd990401c37ec3b466ae; \>= e5d82a7360d124ae1a38c2a5eac92ba49b125191, \< 856e4b5e53f21edbd15d275dde62228dd94fb2b4; \>= e5d82a7360d124ae1a38c2a5eac92ba49b125191, \< a2e075f40122d8daf587db126c562a67abd69cf9; \>= e5d82a7360d124ae1a38c2a5eac92ba49b125191, \< 616fd34d017000ecf9097368b13d8a266f4920b3; \>= e5d82a7360d124ae1a38c2a5eac92ba49b125191, \< d18dcfe9860e842f394e37ba01ca9440ab2178f4; Linux 5.3.

### Is there a fix for CVE-2022-48869?

Yes. Fixed in Linux 9a39f4626b361ee7aa10fd990401c37ec3b466ae, Linux 856e4b5e53f21edbd15d275dde62228dd94fb2b4, Linux 616fd34d017000ecf9097368b13d8a266f4920b3. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2022-48869?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/9a39f4626b361ee7aa10fd990401c37ec3b466ae>
- patch: <https://git.kernel.org/stable/c/856e4b5e53f21edbd15d275dde62228dd94fb2b4>
- patch: <https://git.kernel.org/stable/c/a2e075f40122d8daf587db126c562a67abd69cf9>
- patch: <https://git.kernel.org/stable/c/616fd34d017000ecf9097368b13d8a266f4920b3>
- patch: <https://git.kernel.org/stable/c/d18dcfe9860e842f394e37ba01ca9440ab2178f4>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-48869>

HTML: <https://flawdb.com/CVE-2022-48869> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-48869>
