CVE-2024-39477
published high CVSS 3.1 · 7.8mm/hugetlb: do not call vma_add_reservation upon ENOMEM
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linuxdf7a6d1f64056aec572162c5d35ed9ff86ece6f3 to < aa998f9dcb34c28448f86e8f5490f20d5eb0eac7 · df7a6d1f64056aec572162c5d35ed9ff86ece6f3 to < 8daf9c702ee7f825f0de8600abff764acfedea13 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux6.9 (affected) · 0 to < 6.9 (unaffected · semver) · 6.9.5 through 6.9.* (unaffected · semver) · 6.10 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 | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: mm/hugetlb: do not call vma_add_reservation upon ENOMEM sysbot reported a splat [1] on __unmap_hugepage_range(). This is because vma_needs_reservation() can return -ENOMEM if allocate_file_region_entries() fails to allocate the file_region struct for the reservation. Check for that and do not call vma_add_reservation() if that is the case, otherwise region_abort() and region_del() will see that we do not have any file_regions. If we detect that vma_needs_reservation() returned -ENOMEM, we clear the hugetlb_restore_reserve flag as if this reservation was still consumed, so free_huge_folio() will not increment the resv count. [1] https://lore.kernel.org/linux-mm/[email protected]/T/#ma5983bc1ab18a54910da83416b3f89f3c7ee43aa
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for 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 reached only through local syscalls on the attacker's own address space — mmap(MAP_HUGETLB), madvise(MADV_DONTNEED), munmap, or process exit driving __unmap_hugepage_range(). There is no network- or adjacent-reachable trigger. AC:L - Every element of the trigger is attacker-controlled and deterministic — the private anonymous hugetlb VMA, the merged reservation region, the drained region_cache, and the middle-page unmap that forces region_del()'s split path; only the file_region kmalloc failure must be induced, which an attacker does by driving memory exhaustion (hugetlb hosts are already memory-tight, and a task that becomes an OOM victim has its GFP_KERNEL allocations fail while exit_mmap runs this exact code). Once the single ENOMEM lands, adds_in_progress stays at -1 permanently and the corruption repeats on ordinary faults without further allocation failures, so the attempt can be retried indefinitely. PR:L - A plain unprivileged local user suffices: hugetlb_file_setup() gates only SHM_HUGETLB on CAP_IPC_LOCK, so anonymous MAP_PRIVATE|MAP_HUGETLB mmap and MADV_DONTNEED on the resulting VMA require no capability. A non-zero hugepage pool is an administrator-side configuration, standard on database, KVM, DPDK and HPC hosts, not a privilege held by the attacker. UI:N - The attacker's own process performs the entire sequence — mmap, fault-in, madvise/munmap — with no action by any other user or victim process. S:U - The corruption is confined to kernel heap objects (struct resv_map and the slab freelist) within the same security authority; no VM, hypervisor, or IOMMU boundary is crossed. C:H - region_del() and get_file_region_entry_from_cache() fabricate a file_region pointing at the resv_map itself and then kfree() that interior pointer while the object is still live, producing overlapping slab objects and a freelist containing a misaligned pointer — a well-known route to reading adjacent kernel heap contents. The corrupted rw_semaphore also breaks the serialization of hugetlb page-table walks against unmapping, widening the disclosure surface. I:H - The bogus file_region overlays struct resv_map, so nrg->from/nrg->to and copy_hugetlb_cgroup_uncharge_info() perform out-of-bounds writes over region_cache_count and the rw_semaphore (count, owner, wait_lock) that guards private hugetlb page tables, and kfree() of an interior pointer corrupts the SLUB freelist — a controllable heap-grooming primitive toward arbitrary write and control-flow hijack. The reservation accounting is also permanently falsified, letting one process steal huge pages reserved by another. A:H - On CONFIG_DEBUG_VM kernels this is an immediate panic via VM_BUG_ON(!resv->region_cache_count) in region_abort() and VM_BUG_ON(adds_in_progress) in resv_map_release() — precisely the syzbot splat. Without DEBUG_VM the list poisoning, wrecked rw_semaphore (hangs/deadlock in hugetlb faults), slab corruption, and permanently inflated h->resv_huge_pages produce oopses and SIGBUS-level denial of hugepages for every user on the system.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | df7a6d1f64056aec572162c5d35ed9ff86ece6f3 to < aa998f9dcb34c28448f86e8f5490f20d5eb0eac7 (affected · git)df7a6d1f64056aec572162c5d35ed9ff86ece6f3 to < 8daf9c702ee7f825f0de8600abff764acfedea13 (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 6.9 (affected)0 to < 6.9 (unaffected · semver)6.9.5 through 6.9.* (unaffected · semver)6.10 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
2Provider assertions
3Linux · cna
mm/hugetlb: do not call vma_add_reservation upon ENOMEM
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 6edf9ba361fb1c97d16746a3133f523f1b723e183c4fc6d0cd376fd6300080b0
- Ingested
- 23 Sep 2026, 08:25:18 UTC
- Source record
- Official CVE record