CVE-2022-48988CWE-416

CVE-2022-48988

High · published October 22, 2024

CVSS v3.1
7.8
EPSS
0%
Percentile
14.8
In the wild
Unconfirmed
What it is

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

memcg: fix possible use-after-free in memcg_write_event_control()

memcg_write_event_control() accesses the dentry->d_name of the specified

control fd to route the write call. As a cgroup interface file can't be

renamed, it's safe to access d_name as long as the specified file is a

regular cgroup file. Also, as these cgroup interface files can't be

removed before the directory, it's safe to access the parent too.

Prior to 347c4a874710 ("memcg: remove cgroup_event->cft"), there was a

call to __file_cft() which verified that the specified file is a regular

cgroupfs file before further accesses. The cftype pointer returned from

__file_cft() was no longer necessary and the commit inadvertently dropped

the file type check with it allowing any file to slip through. With the

invarients broken, the d_name and parent accesses can now race against

renames and removals of arbitrary files and cause use-after-free's.

Fix the bug by resurrecting the file type check in __file_cft(). Now that

cgroupfs is implemented through kernfs, checking the file operations needs

to go through a layer of indirection. Instead, let's check the superblock

and dentry type.

The record
Technical detail
CVSS v3.1
7.8 · HIGH
Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.00245 · 14.8th percentile
Weakness
CWE-416 · Use After Free
Published
2024-10-22T00:15Z
Affected products (14)
ProductVersionsFixed in
linux/linux_kernel≥ 3.14, < 4.14.3024.14.302
linux/linux_kernel≥ 4.15, < 4.19.2694.19.269
linux/linux_kernel≥ 4.20, < 5.4.2275.4.227
linux/linux_kernel≥ 5.5, < 5.10.1595.10.159
linux/linux_kernel≥ 5.11, < 5.15.835.15.83
linux/linux_kernel≥ 5.16, < 6.0.136.0.13
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
References (7)
EPSS history
Timeline
  • 21 OCT 20:06Z
    memcg: fix possible use-after-free in memcg_write_event_control()
    cvelistv5