# CVE-2022-48822: usb: f\_fs: Fix use-after-free for epfile

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; 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.32% (percentile 17, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-07-16T11:44:08.638Z
- **Modified:** 2026-08-05T08:52:31.008Z

## Who should check

- Anyone running Linux \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< 32048f4be071f9a6966744243f1786f45bb22dc2; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< cfe5f6fd335d882bcc829a1c8a7d462a455c626e; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< c9fc422c9a43e3d58d246334a71f3390401781dc; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< 0042178a69eb77a979e36a50dcce9794a3140ef8; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< 72a8aee863af099d4434314c4536d6c9a61dcf3c; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< 3e078b18753669615301d946297bafd69294ad2c; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< ebe2b1add1055b903e2acd86b290a85297edc0b3; 5cd8f6788ff34999dbd4cbec81a6adfc215e1e60; \>= 4.8.10, \< 4.9
- Anyone running Linux 4.9

## Description

In the Linux kernel, the following vulnerability has been resolved:

usb: f\_fs: Fix use-after-free for epfile

Consider a case where ffs\_func\_eps\_disable is called from
ffs\_func\_disable as part of composition switch and at the
same time ffs\_epfile\_release get called from userspace.
ffs\_epfile\_release will free up the read buffer and call
ffs\_data\_closed which in turn destroys ffs-\>epfiles and
mark it as NULL. While this was happening the driver has
already initialized the local epfile in ffs\_func\_eps\_disable
which is now freed and waiting to acquire the spinlock. Once
spinlock is acquired the driver proceeds with the stale value
of epfile and tries to free the already freed read buffer
causing use-after-free.

Following is the illustration of the race:

      CPU1                                  CPU2

   ffs\_func\_eps\_disable
   epfiles (local copy)
					ffs\_epfile\_release
					ffs\_data\_closed
					if (last file closed)
					ffs\_data\_reset
					ffs\_data\_clear
					ffs\_epfiles\_destroy
spin\_lock
dereference epfiles

Fix this races by taking epfiles local copy & assigning it under
spinlock and if epfiles(local) is null then update it in ffs-\>epfiles
then finally destroy it.
Extending the scope further from the race, protecting the ep related
structures, and concurrent accesses.

## Affected and fixed versions

- Linux: \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< 32048f4be071f9a6966744243f1786f45bb22dc2; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< cfe5f6fd335d882bcc829a1c8a7d462a455c626e; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< c9fc422c9a43e3d58d246334a71f3390401781dc; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< 0042178a69eb77a979e36a50dcce9794a3140ef8; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< 72a8aee863af099d4434314c4536d6c9a61dcf3c; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< 3e078b18753669615301d946297bafd69294ad2c; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< ebe2b1add1055b903e2acd86b290a85297edc0b3; 5cd8f6788ff34999dbd4cbec81a6adfc215e1e60; \>= 4.8.10, \< 4.9 (cvelist)
- Linux: 4.9 (cvelist)

## Mitigation

- Upgrade Linux to 4.9 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2022-48822.md
Affected: Linux >= a9e6f83c2df199187a5248f824f31b6787ae23ae, < 32048f4be071f9a6966744243f1786f45bb22dc2; >= a9e6f83c2df199187a5248f824f31b6787ae23ae, < cfe5f6fd335d882bcc829a1c8a7d462a455c626e; >= a9e6f83c2df199187a5248f824f31b6787ae23ae, < c9fc422c9a43e3d58d246334a71f3390401781dc; >= a9e6f83c2df199187a5248f…
Fixed in: Linux 32048f4be071f9a6966744243f1786f45bb22dc2, Linux 0042178a69eb77a979e36a50dcce9794a3140ef8, Linux 72a8aee863af099d4434314c4536d6c9a61dcf3c, Linux 3e078b18753669615301d946297bafd69294ad2c, Linux 4.9

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-48822 being exploited?

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

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

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< 32048f4be071f9a6966744243f1786f45bb22dc2; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< cfe5f6fd335d882bcc829a1c8a7d462a455c626e; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< c9fc422c9a43e3d58d246334a71f3390401781dc; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< 0042178a69eb77a979e36a50dcce9794a3140ef8; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< 72a8aee863af099d4434314c4536d6c9a61dcf3c; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< 3e078b18753669615301d946297bafd69294ad2c; \>= a9e6f83c2df199187a5248f824f31b6787ae23ae, \< ebe2b1add1055b903e2acd86b290a85297edc0b3; 5cd8f6788ff34999dbd4cbec81a6adfc215e1e60; \>= 4.8.10, \< 4.9; Linux 4.9.

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

Yes. Fixed in Linux 32048f4be071f9a6966744243f1786f45bb22dc2, Linux 0042178a69eb77a979e36a50dcce9794a3140ef8, Linux 72a8aee863af099d4434314c4536d6c9a61dcf3c, Linux 3e078b18753669615301d946297bafd69294ad2c, Linux 4.9. Upgrade Linux to 4.9 or later.

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

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/32048f4be071f9a6966744243f1786f45bb22dc2>
- patch: <https://git.kernel.org/stable/c/cfe5f6fd335d882bcc829a1c8a7d462a455c626e>
- patch: <https://git.kernel.org/stable/c/c9fc422c9a43e3d58d246334a71f3390401781dc>
- patch: <https://git.kernel.org/stable/c/0042178a69eb77a979e36a50dcce9794a3140ef8>
- patch: <https://git.kernel.org/stable/c/72a8aee863af099d4434314c4536d6c9a61dcf3c>
- patch: <https://git.kernel.org/stable/c/3e078b18753669615301d946297bafd69294ad2c>
- patch: <https://git.kernel.org/stable/c/ebe2b1add1055b903e2acd86b290a85297edc0b3>

## 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-48822>

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