CVE-2026-89752: mm: memcg: stop reclaim when a limit update is superseded
In the Linux kernel, the following vulnerability has been resolved:
mm: memcg: stop reclaim when a limit update is superseded
kernfs serializes file operations only per open file, so separate open files can update the same memory.high or memory.max file concurrently. Both handlers store the new limit before synchronous reclaim, but continue to use the writer's local target in the reclaim loop. If another writer raises or removes the limit, the first writer can continue reclaiming toward a stale target.
For memory.max, this can leave the writer looping indefinitely once reclaim retries are exhausted. The OOM path sees sufficient margin under the current limit and returns true without killing, while the writer still compares usage against its stale target and records another OOM event.
Check the current limit at the start of each reclaim iteration and stop if it no longer matches the writer's target.
Reproducer:
Populate a cgroup with anonymous memory and disable swapping. Lower memory.max from one open file, then restore it to "max" through another open file after the new limit becomes visible.
Without the patch, the first writer remains blocked and repeatedly increments the OOM event counter. With the patch, it returns normally.
This was not motivated by a reported production workload. We found it through automated randomized testing for our cgroup observability work and reduced it to the reproducer above.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Linux kernel (mm: memcg)to a version that resolves this vulnerability.Patch Lower - Compensating control
Populate a cgroup with anonymous memory and disable swapping to avoid the vulnerable reclaim/OOM behavior in the described scenario.
Event History
Frequently Asked Questions
Who is exposed to this issue?
Systems using memory cgroups where more than one open file can concurrently write to the same memory.high or memory.max control file are exposed. The affected behavior requires concurrent limit updates to the same cgroup setting.
What does an attacker or triggering workload need to do?
It needs the ability to perform cgroup memory-limit updates through separate open file handles. One writer lowers a limit and begins synchronous reclaim, while another raises the limit or changes memory.max to "max" after the lower limit becomes visible.
What happens if the issue is triggered?
The first limit writer can continue reclaiming toward its obsolete limit rather than the current one. For memory.max, it can remain blocked indefinitely after reclaim retries are exhausted and repeatedly record OOM events without an OOM kill occurring.
How can I tell whether a system may already be affected?
Look for a blocked writer updating memory.max after another writer has raised or removed that limit. A corresponding symptom is repeated OOM events for the cgroup even though its usage has sufficient margin under the current memory.max value.
What can be done before applying the fix?
Avoid concurrent writes to the same cgroup's memory.high or memory.max files, especially sequences that lower memory.max and then restore it through a separate open file. Serialize limit-management operations so the reclaiming writer's target is not superseded.