CVE-2022-48822 json
usb: f_fs: Fix use-after-free for epfile
published 2024-07-16 2 y ago modified 2026-08-05 3 mo ago also EUVD-2022-53701
- cvss
- 7.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.3%
- EPSS 0.3% chance of exploitation in 30 days, percentile 20%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- Linux Linux 4.9, 4.14.267, 4.19.230, 5.4.180, 5.10.101, 5.15.24, 5.16.10, 5.17
- linux Debian 14, Debian 13, Debian 12 5.16.10-1
debian advisories DEBIAN-CVE-2022-48822
- linux Ubuntu 18.04 LTS 4.15.0-177.186
- linux Ubuntu 20.04 LTS 5.4.0-110.124
- linux-aws Ubuntu 18.04 LTS 4.15.0-1128.137
- linux-aws Ubuntu 20.04 LTS 5.4.0-1073.78
- linux-gcp Ubuntu 20.04 LTS 5.4.0-1073.78
- linux-ibm Ubuntu 20.04 LTS 5.4.0-1021.23
- linux-iot Ubuntu 20.04 LTS 5.4.0-1004.6
- linux-kvm Ubuntu 18.04 LTS 4.15.0-1114.117
ubuntu advisories UBUNTU-CVE-2022-48822
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kernel-azure SLES for SAP 12 SP5, SLES 12 SP5 4.12.14-16.197.1
- kernel-syms-azure SLES for SAP 12 SP5, SLES 12 SP5 4.12.14-16.197.1
- kernel-source-azure SLES for SAP 12 SP5, SLES 12 SP5 4.12.14-16.197.1
- kernel-syms SLES for SAP 12 SP5, SLES 12 SP5 4.12.14-122.228.1
- kernel-source SLES for SAP 12 SP5, SLES 12 SP5 4.12.14-122.228.1
- kernel-default SLES for SAP 12 SP5, SLES 12 SP5, SLE Workstation Extension 12 SP5 +2 more 4.12.14-122.228.1
- kernel-obs-build SLE Software Development Kit 12 SP5 4.12.14-122.228.2
- kernel-rt SLE Real Time 12 SP5 4.12.14-10.200.1
suse advisories SUSE-SU-2024:3252-1SUSE-SU-2024:3251-1SUSE-SU-2024:3189-1SUSE-SU-2024:2948-1SUSE-SU-2024:2947-1SUSE-SU-2024:2939-1
- git.kernel.org/stable/c/32048f4be071f9a6966744243f1786f45bb22dc2 commit
- git.kernel.org/stable/c/cfe5f6fd335d882bcc829a1c8a7d462a455c626e commit
- git.kernel.org/stable/c/c9fc422c9a43e3d58d246334a71f3390401781dc commit
- git.kernel.org/stable/c/0042178a69eb77a979e36a50dcce9794a3140ef8 commit
- git.kernel.org/stable/c/72a8aee863af099d4434314c4536d6c9a61dcf3c commit
- git.kernel.org/stable/c/3e078b18753669615301d946297bafd69294ad2c commit
- git.kernel.org/stable/c/ebe2b1add1055b903e2acd86b290a85297edc0b3 commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-48822 updated cvss 4.4
kernel: usb: f_fs: Fix use-after-free for epfile
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 more Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 2 y ago
Exploit prediction
0.27% chance of exploitation in the next 30 days, higher than 20% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected products
- Linux Linux
Classification
- Weakness
-
- CWE-416 Use After Free
- Technology feeds
References
-
git.kernel.org
/stable/c/32048f4be071f9a6966744243f1786f45bb22dc2
patch
-
git.kernel.org
/stable/c/cfe5f6fd335d882bcc829a1c8a7d462a455c626e
patch
-
git.kernel.org
/stable/c/c9fc422c9a43e3d58d246334a71f3390401781dc
patch
-
git.kernel.org
/stable/c/0042178a69eb77a979e36a50dcce9794a3140ef8
patch
-
git.kernel.org
/stable/c/72a8aee863af099d4434314c4536d6c9a61dcf3c
patch
-
git.kernel.org
/stable/c/3e078b18753669615301d946297bafd69294ad2c
patch
-
git.kernel.org
/stable/c/ebe2b1add1055b903e2acd86b290a85297edc0b3
patch
Sources
- CVE List CVE-2022-48822
- NVD CVE-2022-48822
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.