CVE-2022-48988

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

7.8 high EPSS 0.25%

Published 21 Oct 2024 Updated 5 Aug 2026 CNA: Linux

Check your servers for CVE-2022-48988

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2022-48988 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

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.

Severity (CVSS)

7.8 high CVSS 3.1 from Linux (CNA)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Attack vector
local: the attacker needs local access, or a user has to open a prepared file
Attack complexity
low: an attack works without special conditions
Privileges required
low: the attacker needs an ordinary user account
User interaction
none: nobody has to click or open anything
Scope
unchanged: the damage stays inside the vulnerable component
Impact
confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.25%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 16.8% of all scored CVEs. Scores of 1 Dec 2026.

The assessment of CISA (SSVC, 22 Oct 2024):

Exploitation
none: CISA did not find evidence of exploitation or a public proof of concept
Automatable
no: each attack takes manual steps
Technical impact
partial: limited control or limited data

Affected products

As the CNA lists them.

ProductVersions
Linux
affected from 347c4a8747104a945ecced358944e42879176ca5, before b77600e26fd48727a95ffd50ba1e937efb548125
affected from 347c4a8747104a945ecced358944e42879176ca5, before e1ae97624ecf400ea56c238bff23e5cd139df0b8
affected from 347c4a8747104a945ecced358944e42879176ca5, before 35963b31821920908e397146502066f6b032c917
affected from 347c4a8747104a945ecced358944e42879176ca5, before f1f7f36cf682fa59db15e2089039a2eeb58ff2ad
affected from 347c4a8747104a945ecced358944e42879176ca5, before aad8bbd17a1d586005feb9226c2e9cfce1432e13
affected from 347c4a8747104a945ecced358944e42879176ca5, before 0ed074317b835caa6c03bcfa8f133365324673dc
affected from 347c4a8747104a945ecced358944e42879176ca5, before 4a7ba45b1a435e7097ca0f79a847d0949d0eb088
Other versions: unaffected
Linux
affected 3.14
unaffected before 3.14
unaffected from 4.14.302 up to and including 4.14.*
unaffected from 4.19.269 up to and including 4.19.*
unaffected from 5.4.227 up to and including 5.4.*
unaffected from 5.10.159 up to and including 5.10.*
unaffected from 5.15.83 up to and including 5.15.*
unaffected from 6.0.13 up to and including 6.0.*
unaffected 6.1 and later
Other versions: affected

Is my server affected?

This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:

uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2022-48988 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2022-48988

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2022-48988
trivy image --scanners vuln IMAGE | grep CVE-2022-48988

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Other references

Source: the record CVE-2022-48988 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.