# CVE-2022-48988: memcg: fix possible use-after-free in memcg\_write\_event\_control()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.30% (percentile 16, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-10-21T20:06:04.601Z
- **Modified:** 2026-08-05T08:53:17.372Z

## Who should check

- Anyone running Linux \>= 347c4a8747104a945ecced358944e42879176ca5, \< b77600e26fd48727a95ffd50ba1e937efb548125; \>= 347c4a8747104a945ecced358944e42879176ca5, \< e1ae97624ecf400ea56c238bff23e5cd139df0b8; \>= 347c4a8747104a945ecced358944e42879176ca5, \< 35963b31821920908e397146502066f6b032c917; \>= 347c4a8747104a945ecced358944e42879176ca5, \< f1f7f36cf682fa59db15e2089039a2eeb58ff2ad; \>= 347c4a8747104a945ecced358944e42879176ca5, \< aad8bbd17a1d586005feb9226c2e9cfce1432e13; \>= 347c4a8747104a945ecced358944e42879176ca5, \< 0ed074317b835caa6c03bcfa8f133365324673dc; \>= 347c4a8747104a945ecced358944e42879176ca5, \< 4a7ba45b1a435e7097ca0f79a847d0949d0eb088
- Anyone running Linux 3.14

## 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 and fixed versions

- Linux: \>= 347c4a8747104a945ecced358944e42879176ca5, \< b77600e26fd48727a95ffd50ba1e937efb548125; \>= 347c4a8747104a945ecced358944e42879176ca5, \< e1ae97624ecf400ea56c238bff23e5cd139df0b8; \>= 347c4a8747104a945ecced358944e42879176ca5, \< 35963b31821920908e397146502066f6b032c917; \>= 347c4a8747104a945ecced358944e42879176ca5, \< f1f7f36cf682fa59db15e2089039a2eeb58ff2ad; \>= 347c4a8747104a945ecced358944e42879176ca5, \< aad8bbd17a1d586005feb9226c2e9cfce1432e13; \>= 347c4a8747104a945ecced358944e42879176ca5, \< 0ed074317b835caa6c03bcfa8f133365324673dc; \>= 347c4a8747104a945ecced358944e42879176ca5, \< 4a7ba45b1a435e7097ca0f79a847d0949d0eb088 (cvelist)
- Linux: 3.14 (cvelist)

## Mitigation

- Upgrade Linux to 4a7ba45b1a435e7097ca0f79a847d0949d0eb088 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-48988. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-48988.md
Affected: Linux >= 347c4a8747104a945ecced358944e42879176ca5, < b77600e26fd48727a95ffd50ba1e937efb548125; >= 347c4a8747104a945ecced358944e42879176ca5, < e1ae97624ecf400ea56c238bff23e5cd139df0b8; >= 347c4a8747104a945ecced358944e42879176ca5, < 35963b31821920908e397146502066f6b032c917; >= 347c4a8747104a945ecced3…
Fixed in: Linux 35963b31821920908e397146502066f6b032c917, Linux 0ed074317b835caa6c03bcfa8f133365324673dc, Linux 4a7ba45b1a435e7097ca0f79a847d0949d0eb088

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-48988 being exploited?

There is no confirmed exploitation: CVE-2022-48988 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.30% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-48988?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-48988?

Linux \>= 347c4a8747104a945ecced358944e42879176ca5, \< b77600e26fd48727a95ffd50ba1e937efb548125; \>= 347c4a8747104a945ecced358944e42879176ca5, \< e1ae97624ecf400ea56c238bff23e5cd139df0b8; \>= 347c4a8747104a945ecced358944e42879176ca5, \< 35963b31821920908e397146502066f6b032c917; \>= 347c4a8747104a945ecced358944e42879176ca5, \< f1f7f36cf682fa59db15e2089039a2eeb58ff2ad; \>= 347c4a8747104a945ecced358944e42879176ca5, \< aad8bbd17a1d586005feb9226c2e9cfce1432e13; \>= 347c4a8747104a945ecced358944e42879176ca5, \< 0ed074317b835caa6c03bcfa8f133365324673dc; \>= 347c4a8747104a945ecced358944e42879176ca5, \< 4a7ba45b1a435e7097ca0f79a847d0949d0eb088; Linux 3.14.

### Is there a fix for CVE-2022-48988?

Yes. Fixed in Linux 35963b31821920908e397146502066f6b032c917, Linux 0ed074317b835caa6c03bcfa8f133365324673dc, Linux 4a7ba45b1a435e7097ca0f79a847d0949d0eb088. Upgrade Linux to 4a7ba45b1a435e7097ca0f79a847d0949d0eb088 or later.

### How do I check if I'm affected by CVE-2022-48988?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/b77600e26fd48727a95ffd50ba1e937efb548125>
- patch: <https://git.kernel.org/stable/c/e1ae97624ecf400ea56c238bff23e5cd139df0b8>
- patch: <https://git.kernel.org/stable/c/35963b31821920908e397146502066f6b032c917>
- patch: <https://git.kernel.org/stable/c/f1f7f36cf682fa59db15e2089039a2eeb58ff2ad>
- patch: <https://git.kernel.org/stable/c/aad8bbd17a1d586005feb9226c2e9cfce1432e13>
- patch: <https://git.kernel.org/stable/c/0ed074317b835caa6c03bcfa8f133365324673dc>
- patch: <https://git.kernel.org/stable/c/4a7ba45b1a435e7097ca0f79a847d0949d0eb088>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-48988>

HTML: <https://flawdb.com/CVE-2022-48988> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-48988>
