7.8
HIGH
CVE-2022-48822
Linux usb fs Use-After-Free Vulnerability
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.

INFO

Published Date :

July 16, 2024, 12:15 p.m.

Last Modified :

Aug. 7, 2024, 7:14 p.m.

Source :

416baaa9-dc9f-4396-8d5f-8c081fb06d67

Remotely Exploitable :

No

Impact Score :

5.9

Exploitability Score :

1.8
Affected Products

The following products are affected by CVE-2022-48822 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Linux linux_kernel

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2022-48822 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2022-48822 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • Initial Analysis by [email protected]

    Aug. 07, 2024

    Action Type Old Value New Value
    Added CVSS V3.1 NIST AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
    Changed Reference Type https://git.kernel.org/stable/c/0042178a69eb77a979e36a50dcce9794a3140ef8 No Types Assigned https://git.kernel.org/stable/c/0042178a69eb77a979e36a50dcce9794a3140ef8 Patch
    Changed Reference Type https://git.kernel.org/stable/c/32048f4be071f9a6966744243f1786f45bb22dc2 No Types Assigned https://git.kernel.org/stable/c/32048f4be071f9a6966744243f1786f45bb22dc2 Patch
    Changed Reference Type https://git.kernel.org/stable/c/3e078b18753669615301d946297bafd69294ad2c No Types Assigned https://git.kernel.org/stable/c/3e078b18753669615301d946297bafd69294ad2c Patch
    Changed Reference Type https://git.kernel.org/stable/c/72a8aee863af099d4434314c4536d6c9a61dcf3c No Types Assigned https://git.kernel.org/stable/c/72a8aee863af099d4434314c4536d6c9a61dcf3c Patch
    Changed Reference Type https://git.kernel.org/stable/c/c9fc422c9a43e3d58d246334a71f3390401781dc No Types Assigned https://git.kernel.org/stable/c/c9fc422c9a43e3d58d246334a71f3390401781dc Patch
    Changed Reference Type https://git.kernel.org/stable/c/cfe5f6fd335d882bcc829a1c8a7d462a455c626e No Types Assigned https://git.kernel.org/stable/c/cfe5f6fd335d882bcc829a1c8a7d462a455c626e Patch
    Changed Reference Type https://git.kernel.org/stable/c/ebe2b1add1055b903e2acd86b290a85297edc0b3 No Types Assigned https://git.kernel.org/stable/c/ebe2b1add1055b903e2acd86b290a85297edc0b3 Patch
    Added CWE NIST CWE-416
    Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.9 up to (excluding) 4.14.267 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.15 up to (excluding) 4.19.230 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 4.20 up to (excluding) 5.4.180 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.5 up to (excluding) 5.10.101 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.11 up to (excluding) 5.15.24 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.16 up to (excluding) 5.16.10
  • CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67

    Jul. 16, 2024

    Action Type Old Value New Value
    Added 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.
    Added Reference kernel.org https://git.kernel.org/stable/c/32048f4be071f9a6966744243f1786f45bb22dc2 [No types assigned]
    Added Reference kernel.org https://git.kernel.org/stable/c/cfe5f6fd335d882bcc829a1c8a7d462a455c626e [No types assigned]
    Added Reference kernel.org https://git.kernel.org/stable/c/c9fc422c9a43e3d58d246334a71f3390401781dc [No types assigned]
    Added Reference kernel.org https://git.kernel.org/stable/c/0042178a69eb77a979e36a50dcce9794a3140ef8 [No types assigned]
    Added Reference kernel.org https://git.kernel.org/stable/c/72a8aee863af099d4434314c4536d6c9a61dcf3c [No types assigned]
    Added Reference kernel.org https://git.kernel.org/stable/c/3e078b18753669615301d946297bafd69294ad2c [No types assigned]
    Added Reference kernel.org https://git.kernel.org/stable/c/ebe2b1add1055b903e2acd86b290a85297edc0b3 [No types assigned]
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.
CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2022-48822 is associated with the following CWEs:

Common Attack Pattern Enumeration and Classification (CAPEC)

Common Attack Pattern Enumeration and Classification (CAPEC) stores attack patterns, which are descriptions of the common attributes and approaches employed by adversaries to exploit the CVE-2022-48822 weaknesses.

CVSS31 - Vulnerability Scoring System
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality
Integrity
Availability