CyberSecBulletin
CVE-2022-48822NVD status: Modified

Linux: Use After Free

CVE-2022-48822 is a high-severity use after free vulnerability in Linux, with a CVSS 3.1 base score of 7.8 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, without any action from a user. The record lists versions 32048f4be071f9a6966744243f1786f45bb22dc2, cfe5f6fd335d882bcc829a1c8a7d462a455c626e, c9fc422c9a43e3d58d246334a71f3390401781dc as the first without the flaw, so updating Linux to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.27% chance of exploitation within 30 days, which is low compared with other CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Linux to 32048f4be071f9a6966744243f1786f45bb22dc2 or cfe5f6fd335d882bcc829a1c8a7d462a455c626e or c9fc422c9a43e3d58d246334a71f3390401781dc or 0042178a69eb77a979e36a50dcce9794a3140ef8, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 4.14.267 or 4.19.230 or 5.4.180 or 5.10.101, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinuxa9e6f83c2df199187a5248f824f31b6787ae23ae up to, but not including, 32048f4be071f9a6966744243f1786f45bb22dc2; a9e6f83c2df199187a5248f824f31b6787ae23ae up to, but not including, cfe5f6fd335d882bcc829a1c8a7d462a455c626e; a9e6f83c2df199187a5248f824f31b6787ae23ae up to, but not including, c9fc422c9a43e3d58d246334a71f3390401781dc; a9e6f83c2df199187a5248f824f31b6787ae23ae up to, but not including, 0042178a69eb77a979e36a50dcce9794a3140ef8; a9e6f83c2df199187a5248f824f31b6787ae23ae up to, but not including, 72a8aee863af099d4434314c4536d6c9a61dcf3c; a9e6f83c2df199187a5248f824f31b6787ae23ae up to, but not including, 3e078b18753669615301d946297bafd69294ad2c; a9e6f83c2df199187a5248f824f31b6787ae23ae up to, but not including, ebe2b1add1055b903e2acd86b290a85297edc0b3; 5cd8f6788ff34999dbd4cbec81a6adfc215e1e60; and 2 more ranges32048f4be071f9a6966744243f1786f45bb22dc2, cfe5f6fd335d882bcc829a1c8a7d462a455c626e, c9fc422c9a43e3d58d246334a71f3390401781dc, 0042178a69eb77a979e36a50dcce9794a3140ef8, 72a8aee863af099d4434314c4536d6c9a61dcf3c, 3e078b18753669615301d946297bafd69294ad2c
LinuxLinux Kernel4.9 up to, but not including, 4.14.267; 4.15 up to, but not including, 4.19.230; 4.20 up to, but not including, 5.4.180; 5.5 up to, but not including, 5.10.101; 5.11 up to, but not including, 5.15.24; 5.16 up to, but not including, 5.16.104.14.267, 4.19.230, 5.4.180, 5.10.101, 5.15.24, 5.16.10

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
LocalThe attacker needs local access or must trick a user into running something.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
LowA basic user account is enough.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.17.8HighCNA
CVSS 3.17.8HighNVD

Official 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.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Use After Free

The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory belongs to the code that operates on the new pointer.

How developers prevent this class of flaw

  • Choose a language that provides automatic memory management.
  • When freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures may lower the usefulness of this strategy.

More Use After Free vulnerabilities (CWE-416)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: partial).
  3. Record last changed materially (score, affected products, status or references).

References

Recent Use After Free vulnerabilities

Spotted an error? Tell us.