VDB

CVE-2024-43892

CVE-2024-43892 PUBLISHED CVSS 7.8 HIGH

memcg: protect concurrent access to mem_cgroup_idr

Reported by linux · Published August 26, 2024

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.

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
kernel-develAmazon Linux6.1.111-120.187.amzn2023
kernel-libbpf-staticAmazon Linux6.1.111-120.187.amzn2023
bpftoolAmazon Linux6.1.111-120.187.amzn2023
kernelAmazon Linux6.1.111-120.187.amzn2023

Risk scores

CVSS 3.1
7.8
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected products

VendorProductVersions
LinuxLinux73f576c04b9410ed19660f74f97521bee6e1c546, 73f576c04b9410ed19660f74f97521bee6e1c546, 73f576c04b9410ed19660f74f97521bee6e1c546
LinuxLinux4.7, 0, 5.10.226
amazon:2023kernel-devel0
amazon:2023kernel-libbpf-static0
amazon:2023bpftool0
amazon:2023kernel0
linuxlinux_kernel4.7, 4.7, 4.7
amazon:2023kernel-livepatch-6.1.111-120.1870
amazon:2023kernel-modules-extra0
amazon:2023kernel-libbpf-devel0
amazon:2023kernel-tools-devel0
amazon:2023kernel-headers0
amazon:2023kernel-libbpf0
amazon:2023kernel-modules-extra-common0
amazon:2023perf0
amazon:2023kernel-tools0
amazon:2023python3-perf0
LinuxLinux8627c7750a66a46d56d3564e1e881aa53764497c, 4.7, 0

Timeline

  • Aug 26, 2024 CVE Published
  • Aug 27, 2024 EPSS Score (30 in total, the first dated here)
  • Oct 4, 2024 Coalition ESS Score (15 in total, the first dated here)
  • Jan 5, 2026 Security Advisory (155 in total, the first dated here)
  • Mar 30, 2026 Distribution Patch (142 in total, the first dated here)

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2024-43892
vulnetix vdb fixes CVE-2024-43892

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-43892/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›