CVE-2022-48988

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

HIGH
7
CVSS Score
Published: October 21, 2024 at 08:06 PM UTC
Updated: August 5, 2026 at 09:24 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7
Exploit prediction
EPSS 0.2%
SSVC
No known exploit

Description

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

3.14 ≤ v < 4.14.3023.14 ≤ v < 4.19.2693.14 ≤ v < 5.10.1593.14 ≤ v < 5.15.833.14 ≤ v < 5.4.2273.14 ≤ v < 6.0.133.14 ≤ v < 6.14.15 ≤ v < 4.19.2694.20 ≤ v < 5.4.2275.11 ≤ v < 5.15.835.16 ≤ v < 6.0.135.5 ≤ v < 5.10.159347c4a8747104a945ecced358944e42879176ca56.1 rc16.1 rc26.1 rc36.1 rc46.1 rc56.1 rc66.1 rc76.1 rc8
Vendor states this is fixed in 0ed074317b835caa6c03bcfa8f133365324673dc (fixed)
Vendor states this is fixed in 35963b31821920908e397146502066f6b032c917 (fixed)
Vendor states this is fixed in 4a7ba45b1a435e7097ca0f79a847d0949d0eb088 (fixed)
Vendor states this is fixed in aad8bbd17a1d586005feb9226c2e9cfce1432e13 (fixed)
Vendor states this is fixed in b77600e26fd48727a95ffd50ba1e937efb548125 (fixed)
Vendor states this is fixed in e1ae97624ecf400ea56c238bff23e5cd139df0b8 (fixed)
Vendor states this is fixed in f1f7f36cf682fa59db15e2089039a2eeb58ff2ad (fixed)
Vendor states this is fixed in 3.14 (unaffected)
Vendor states this is fixed in 4.14.302 (unaffected)
Vendor states this is fixed in 4.19.269 (unaffected)
Vendor states this is fixed in 5.10.159 (unaffected)
Vendor states this is fixed in 5.15.83 (unaffected)
Vendor states this is fixed in 5.4.227 (unaffected)
Vendor states this is fixed in 6.0.13 (unaffected)
Vendor states this is fixed in 6.1 (unaffected)

References (7)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/0ed074317b835caa6c03bcfa8f133365324673dc
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/35963b31821920908e397146502066f6b032c917
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/4a7ba45b1a435e7097ca0f79a847d0949d0eb088
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/aad8bbd17a1d586005feb9226c2e9cfce1432e13
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/b77600e26fd48727a95ffd50ba1e937efb548125
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/e1ae97624ecf400ea56c238bff23e5cd139df0b8
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/f1f7f36cf682fa59db15e2089039a2eeb58ff2ad

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
LOCAL
Complexity
HIGH
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-416

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card