CVE-2021-47011
published high CVSS 3.1 · 7.8mm: memcontrol: slab: fix obtain a reference to a freeing memcg
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux26f54dac15640c65ec69867e182de7be708ea389 to < 31df8bc4d3feca9f9c6b2cd06fd64a111ae1a0e6 · 3de7d4f25a7438f09fef4e71ef111f1805cd8e7c to < 89b1ed358e01e1b0417f5d3b0082359a23355552 · 3de7d4f25a7438f09fef4e71ef111f1805cd8e7c to < c3ae6a3f3ca4f02f6ccddf213c027302586580d0 · 3de7d4f25a7438f09fef4e71ef111f1805cd8e7c to < 9f38f03ae8d5f57371b71aa6b4275765b65454fd · 5.10.11 to < 5.10.37 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux5.11 (affected) · 0 to < 5.11 (unaffected · semver) · 5.10.37 through 5.10.* (unaffected · semver) · 5.11.21 through 5.11.* (unaffected · semver) · 5.12.4 through 5.12.* (unaffected · semver) · 5.13 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2 | Release evaluationALAS2KERNEL-5.10-2022-002 | Fixed | Not stated | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Pending Fix | Not stated | Amazon Linux assessment |
| Red Hat Enterprise Linux | RHEL-8 | bpftoolaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Amazon Linux | AL2 | kernelaarch64 | Listed in advisory | Not stated | ALAS2KERNEL-5.10-2022-002 |
| Red Hat Enterprise Linux | RHEL-8 | bpftoolppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
Show 97 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Red Hat Enterprise Linux | RHEL-8 | bpftools390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | bpftoolx86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | bpftool-debuginfoaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | bpftool-debuginfoppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | bpftool-debuginfos390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | bpftool-debuginfox86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernelaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernelppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernels390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernelsrc | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernelx86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-abi-stablelistsnoarch | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-coreaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-coreppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-cores390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-corex86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debugaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debugppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debugs390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debugx86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-coreaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-coreppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-cores390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-corex86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-debuginfoaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-debuginfoppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-debuginfos390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-debuginfox86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-develaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-develppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-devels390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-develx86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-modulesaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-modulesppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-moduless390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-modulesx86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-modules-extraaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-modules-extrappc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-modules-extras390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debug-modules-extrax86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debuginfoaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debuginfoppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debuginfos390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debuginfox86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debuginfo-common-aarch64aarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debuginfo-common-ppc64leppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debuginfo-common-s390xs390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-debuginfo-common-x86_64x86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-develaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-develppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-devels390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-develx86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-docnoarch | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-modulesaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-modulesppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-moduless390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-modulesx86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-modules-extraaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-modules-extrappc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-modules-extras390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-modules-extrax86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-toolsaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-toolsppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-toolss390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-toolsx86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-tools-debuginfoaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-tools-debuginfoppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-tools-debuginfos390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-tools-debuginfox86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-tools-libsaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-tools-libsppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-tools-libsx86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-zfcpdumps390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-zfcpdump-cores390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-zfcpdump-debuginfos390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-zfcpdump-devels390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-zfcpdump-moduless390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | kernel-zfcpdump-modules-extras390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | perfaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | perfppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | perfs390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | perfx86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | perf-debuginfoaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | perf-debuginfoppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | perf-debuginfos390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | perf-debuginfox86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | python3-perfaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | python3-perfppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | python3-perfs390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | python3-perfx86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | python3-perf-debuginfoaarch64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | python3-perf-debuginfoppc64le | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | python3-perf-debuginfos390x | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Red Hat Enterprise Linux | RHEL-8 | python3-perf-debuginfox86_64 | Advisory build | 4.18.0-348.el8 | RHSA-2021:4356 |
| Amazon Linux | AL2 | kerneli686 | Listed in advisory | Not stated | ALAS2KERNEL-5.10-2022-002 |
| Amazon Linux | AL2 | kernelsrc | Listed in advisory | Not stated | ALAS2KERNEL-5.10-2022-002 |
| Amazon Linux | AL2 | kernelx86_64 | Listed in advisory | Not stated | ALAS2KERNEL-5.10-2022-002 |
Description
In the Linux kernel, the following vulnerability has been resolved: mm: memcontrol: slab: fix obtain a reference to a freeing memcg Patch series "Use obj_cgroup APIs to charge kmem pages", v5. Since Roman's series "The new cgroup slab memory controller" applied. All slab objects are charged with the new APIs of obj_cgroup. The new APIs introduce a struct obj_cgroup to charge slab objects. It prevents long-living objects from pinning the original memory cgroup in the memory. But there are still some corner objects (e.g. allocations larger than order-1 page on SLUB) which are not charged with the new APIs. Those objects (include the pages which are allocated from buddy allocator directly) are charged as kmem pages which still hold a reference to the memory cgroup. E.g. We know that the kernel stack is charged as kmem pages because the size of the kernel stack can be greater than 2 pages (e.g. 16KB on x86_64 or arm64). If we create a thread (suppose the thread stack is charged to memory cgroup A) and then move it from memory cgroup A to memory cgroup B. Because the kernel stack of the thread hold a reference to the memory cgroup A. The thread can pin the memory cgroup A in the memory even if we remove the cgroup A. If we want to see this scenario by using the following script. We can see that the system has added 500 dying cgroups (This is not a real world issue, just a script to show that the large kmallocs are charged as kmem pages which can pin the memory cgroup in the memory). #!/bin/bash cat /proc/cgroups | grep memory cd /sys/fs/cgroup/memory echo 1 > memory.move_charge_at_immigrate for i in range{1..500} do mkdir kmem_test echo $$ > kmem_test/cgroup.procs sleep 3600 & echo $$ > cgroup.procs echo `cat kmem_test/cgroup.procs` > cgroup.procs rmdir kmem_test done cat /proc/cgroups | grep memory This patchset aims to make those kmem pages to drop the reference to memory cgroup by using the APIs of obj_cgroup. Finally, we can see that the number of the dying cgroups will not increase if we run the above test script. This patch (of 7): The rcu_read_lock/unlock only can guarantee that the memcg will not be freed, but it cannot guarantee the success of css_get (which is in the refill_stock when cached memcg changed) to memcg. rcu_read_lock() memcg = obj_cgroup_memcg(old) __memcg_kmem_uncharge(memcg) refill_stock(memcg) if (stock->cached != memcg) // css_get can change the ref counter from 0 back to 1. css_get(&memcg->css) rcu_read_unlock() This fix is very like the commit: eefbfa7fd678 ("mm: memcg/slab: fix use after free in obj_cgroup_charge") Fix this by holding a reference to the memcg which is passed to the __memcg_kmem_uncharge() before calling __memcg_kmem_uncharge().
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The vulnerable path is local memcg slab accounting (kmalloc/slab → obj_cgroup_charge → refill_obj_stock → drain_obj_stock) plus local cgroup offlining; it is not reachable from remote packet processing alone. AC:L - An attacker who can create and destroy memory cgroups (delegated cgroup hierarchy) controls both sides of the race—driving stock drains via accounted allocations while concurrently offlining the memcg—so success does not depend on conditions outside their influence. PR:L - An unprivileged local user in a non-root memory cgroup can trigger the charging path, and on common delegated setups (containers, systemd Delegate=) can create/rmdir memory cgroups without real init-namespace root. UI:N - No victim action is required; the attacker triggers accounted allocations and cgroup offlining with their own processes. S:U - Impact is confined to the local kernel’s authority (memcg/CSS use-after-free leading to local privilege escalation), with no VM, IOMMU, or other security-authority boundary crossed. C:H - The bug resurrects a freeing memcg via css_get on a zero refcount under RCU (explicitly likened to a prior memcg slab UAF), yielding a use-after-free that can be leveraged for arbitrary kernel memory disclosure. I:H - The same memcg/CSS use-after-free enables heap reuse and write primitives against freed cgroup state, which is exploitable for integrity compromise and control-flow hijacking. A:H - Use-after-free on memcg structures can cause kernel oops/panic or hangs when the resurrected or freed object is accessed during stock drain or later puts.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 26f54dac15640c65ec69867e182de7be708ea389 to < 31df8bc4d3feca9f9c6b2cd06fd64a111ae1a0e6 (affected · git)3de7d4f25a7438f09fef4e71ef111f1805cd8e7c to < 89b1ed358e01e1b0417f5d3b0082359a23355552 (affected · git)3de7d4f25a7438f09fef4e71ef111f1805cd8e7c to < c3ae6a3f3ca4f02f6ccddf213c027302586580d0 (affected · git)3de7d4f25a7438f09fef4e71ef111f1805cd8e7c to < 9f38f03ae8d5f57371b71aa6b4275765b65454fd (affected · git)5.10.11 to < 5.10.37 (affected · semver)Default: unaffected | Linux · cna |
| Linux | Linux | 5.11 (affected)0 to < 5.11 (unaffected · semver)5.10.37 through 5.10.* (unaffected · semver)5.11.21 through 5.11.* (unaffected · semver)5.12.4 through 5.12.* (unaffected · semver)5.13 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
4Provider assertions
3Linux · cna
mm: memcontrol: slab: fix obtain a reference to a freeing memcg
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 7339538b4af712da8312e5a2f9e5dc83322114b7e05348bdc8e3139bb159bade
- Ingested
- 23 Sep 2026, 07:57:04 UTC
- Source record
- Official CVE record