CVE-2024-43892

memcg: protect concurrent access to mem_cgroup_idr

MEDIUM
4.7
CVSS Score
Published: August 26, 2024 at 10:10 AM UTC
Updated: August 5, 2026 at 12:04 PM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM4.7
Exploit prediction
EPSS 0.2%
SSVC
No known exploit

Description

In the Linux kernel, the following vulnerability has been resolved: memcg: protect concurrent access to mem_cgroup_idr Commit 73f576c04b94 ("mm: memcontrol: fix cgroup creation failure after many small jobs") decoupled the memcg IDs from the CSS ID space to fix the cgroup creation failures. It introduced IDR to maintain the memcg ID space. The IDR depends on external synchronization mechanisms for modifications. For the mem_cgroup_idr, the idr_alloc() and idr_replace() happen within css callback and thus are protected through cgroup_mutex from concurrent modifications. However idr_remove() for mem_cgroup_idr was not protected against concurrency and can be run concurrently for different memcgs when they hit their refcnt to zero. Fix that. We have been seeing list_lru based kernel crashes at a low frequency in our fleet for a long time. These crashes were in different part of list_lru code including list_lru_add(), list_lru_del() and reparenting code. Upon further inspection, it looked like for a given object (dentry and inode), the super_block's list_lru didn't have list_lru_one for the memcg of that object. The initial suspicions were either the object is not allocated through kmem_cache_alloc_lru() or somehow memcg_list_lru_alloc() failed to allocate list_lru_one() for a memcg but returned success. No evidence were found for these cases. Looking more deeply, we started seeing situations where valid memcg's id is not present in mem_cgroup_idr and in some cases multiple valid memcgs have same id and mem_cgroup_idr is pointing to one of them. So, the most reasonable explanation is that these situations can happen due to race between multiple idr_remove() calls or race between idr_alloc()/idr_replace() and idr_remove(). These races are causing multiple memcgs to acquire the same ID and then offlining of one of them would cleanup list_lrus on the system for all of them. Later access from other memcgs to the list_lru cause crashes due to missing list_lru_one.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v ≥ 4.4.18v ≥ 4.6.64.4.18 ≤ v < 4.54.6.6 ≤ v < 4.74.7 ≤ v < 5.10.2264.7 ≤ v < 5.15.1674.7 ≤ v < 6.1.1104.7 ≤ v < 6.10.54.7 ≤ v < 6.114.7 ≤ v < 6.6.466.7 ≤ v < 6.10.54.4.184.6.66.11 rc16.11 rc273f576c04b9410ed19660f74f97521bee6e1c5468627c7750a66a46d56d3564e1e881aa53764497cdb70cd18d3da727a3a59694de428a9e41c620de7
Vendor states this is fixed in 37a060b64ae83b76600d187d76591ce488ab836b (fixed)
Vendor states this is fixed in 51c0b1bb7541f8893ec1accba59eb04361a70946 (fixed)
Vendor states this is fixed in 56fd70f4aa8b82199dbe7e99366b1fd7a04d86fb (fixed)
Vendor states this is fixed in 912736a0435ef40e6a4ae78197ccb5553cb80b05 (fixed)
Vendor states this is fixed in 9972605a238339b85bd16b084eed5f18414d22db (fixed)
Vendor states this is fixed in e6cc9ff2ac0b5df9f25eb790934c3104f6710278 (fixed)
Affected range stops below 4.5, so it looks safe — our inference, not a vendor statement
Vendor states this is fixed in 4.7 (unaffected)
Vendor states this is fixed in 5.10.226 (unaffected)
Vendor states this is fixed in 5.15.167 (unaffected)
Vendor states this is fixed in 6.1.110 (unaffected)
Vendor states this is fixed in 6.10.5 (unaffected)
Vendor states this is fixed in 6.11 (unaffected)
Vendor states this is fixed in 6.6.46 (unaffected)

References (8)

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
LOCAL
Complexity
HIGH
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
NVD-CWE-noinfo

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card