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

Published Oct 21, 2024
·
Updated

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

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

memcgwriteeventcontrol() accesses the dentry->dname of the specified control fd to route the write call. As a cgroup interface file can't be renamed, it's safe to access dname 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 cgroupevent->cft"), there was a call to filecft() which verified that the specified file is a regular cgroupfs file before further accesses. The cftype pointer returned from filecft() 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 dname 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 filecft(). 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 Software

14 affected components
Linux Linux kernel>=3.14<4.14.302
Linux Linux kernel>=4.15<4.19.269
Linux Linux kernel>=4.20<5.4.227
Linux Linux kernel>=5.5<5.10.159
Linux Linux kernel>=5.11<5.15.83
Linux Linux kernel>=5.16<6.0.13
Linux Linux kernel=6.1-rc1
Linux Linux kernel=6.1-rc2
Linux Linux kernel=6.1-rc3
Linux Linux kernel=6.1-rc4
Linux Linux kernel=6.1-rc5
Linux Linux kernel=6.1-rc6
Linux Linux kernel=6.1-rc7
Linux Linux kernel=6.1-rc8

Event History

Oct 21, 2024
CVE Published
via MITRE·08:06 PM
Data Sourced
via MITRE·08:06 PM
DescriptionSeverity
Data Sourced
via NVD·08:15 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2022-48988?

CVE-2022-48988 has a severity rating based on the potential risk of a use-after-free vulnerability in the Linux kernel memory controller.

2

How do I fix CVE-2022-48988?

To fix CVE-2022-48988, users should update their Linux kernel to a patched version that resolves the vulnerability.

3

Which versions of the Linux kernel are affected by CVE-2022-48988?

CVE-2022-48988 affects multiple versions of the Linux kernel from version 3.14 up to 6.1-rc8, depending on the specific release.

4

What vulnerabilities does CVE-2022-48988 address?

CVE-2022-48988 addresses a use-after-free issue in the memcg_write_event_control function within the Linux kernel.

5

Is CVE-2022-48988 a remote exploit?

CVE-2022-48988 is not classified as a remote exploit, but it could potentially be exploited locally by an attacker with access to the target system.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203