CVE-2024-43892

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-43892
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-43892.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-43892
Downstream
Related
Published
2024-08-26T10:10:46.612Z
Modified
2025-11-28T02:34:23.068693Z
Summary
memcg: protect concurrent access to mem_cgroup_idr
Details

In the Linux kernel, the following vulnerability has been resolved:

memcg: protect concurrent access to memcgroupidr

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 memcgroupidr, the idralloc() and idrreplace() happen within css callback and thus are protected through cgroupmutex from concurrent modifications. However idrremove() for memcgroupidr 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 listlru based kernel crashes at a low frequency in our fleet for a long time. These crashes were in different part of listlru code including listlruadd(), listlrudel() and reparenting code. Upon further inspection, it looked like for a given object (dentry and inode), the superblock's listlru didn't have listlruone for the memcg of that object. The initial suspicions were either the object is not allocated through kmemcachealloclru() or somehow memcglistlrualloc() failed to allocate listlruone() 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 memcgroupidr and in some cases multiple valid memcgs have same id and memcgroupidr is pointing to one of them. So, the most reasonable explanation is that these situations can happen due to race between multiple idrremove() calls or race between idralloc()/idrreplace() and idrremove(). These races are causing multiple memcgs to acquire the same ID and then offlining of one of them would cleanup listlrus on the system for all of them. Later access from other memcgs to the listlru cause crashes due to missing listlruone.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/43xxx/CVE-2024-43892.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
73f576c04b9410ed19660f74f97521bee6e1c546
Fixed
912736a0435ef40e6a4ae78197ccb5553cb80b05
Fixed
e6cc9ff2ac0b5df9f25eb790934c3104f6710278
Fixed
56fd70f4aa8b82199dbe7e99366b1fd7a04d86fb
Fixed
37a060b64ae83b76600d187d76591ce488ab836b
Fixed
51c0b1bb7541f8893ec1accba59eb04361a70946
Fixed
9972605a238339b85bd16b084eed5f18414d22db
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
8627c7750a66a46d56d3564e1e881aa53764497c
Last affected
db70cd18d3da727a3a59694de428a9e41c620de7

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
4.7.0
Fixed
5.10.226
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.167
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.110
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.46
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.10.5