CVE-2022-48988: memcg: fix possible use-after-free in memcg_write_event_control()
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
Event History
Frequently Asked Questions
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.
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.
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.
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.
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.