mm: memcg: stop reclaim when a limit update is superseded
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b6e6edcfa40561e9c8abe5eecf1c96f8e5fd9c6f · < 95d87030cae7764805aa7c621c52871139297cb0| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
Concurrent writes through separate open files to the same memory.high or memory.max cgroup file can leave one writer reclaiming toward a limit that has already changed. For memory.max, the writer can remain blocked indefinitely and repeatedly increment the OOM event counter. This requires local concurrent limit updates; the input does not describe a network attack.
Engineers running Linux kernels that support memory cgroup memory.high or memory.max limits should check whether their kernel includes the fix; affected versions are not specified.