VDB

CVE-2024-49873

CVE-2024-49873 PUBLISHED

mm/filemap: fix filemap_get_folios_contig THP panic

Reported by linux · Published October 21, 2024

In the Linux kernel, the following vulnerability has been resolved: mm/filemap: fix filemap_get_folios_contig THP panic Patch series "memfd-pin huge page fixes". Fix multiple bugs that occur when using memfd_pin_folios with hugetlb pages and THP. The hugetlb bugs only bite when the page is not yet faulted in when memfd_pin_folios is called. The THP bug bites when the starting offset passed to memfd_pin_folios is not huge page aligned. See the commit messages for details. This patch (of 5): memfd_pin_folios on memory backed by THP panics if the requested start offset is not huge page aligned: BUG: kernel NULL pointer dereference, address: 0000000000000036 RIP: 0010:filemap_get_folios_contig+0xdf/0x290 RSP: 0018:ffffc9002092fbe8 EFLAGS: 00010202 RAX: 0000000000000002 RBX: 0000000000000002 RCX: 0000000000000002 The fault occurs here, because xas_load returns a folio with value 2: filemap_get_folios_contig() for (folio = xas_load(&xas); folio && xas.xa_index <= end; folio = xas_next(&xas)) { ... if (!folio_try_get(folio)) <-- BOOM "2" is an xarray sibling entry. We get it because memfd_pin_folios does not round the indices passed to filemap_get_folios_contig to huge page boundaries for THP, so we load from the middle of a huge page range see a sibling. (It does round for hugetlbfs, at the is_file_hugepages test). To fix, if the folio is a sibling, then return the next index as the starting point for the next call to filemap_get_folios_contig.

Fixed versions

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

PackageEcosystemFixed in
linux_kernellinux6.11.3
LinuxLinuxc225c4f6056b46a8a5bf2ed35abf17a2d6887691, 6.11, 570dd14bfecf281fa467c80f8ec92b26370ee36a

Affected products

VendorProductVersions
LinuxLinux89c1905d9c140372b7f50ef48f42378cf85d9bc5, 89c1905d9c140372b7f50ef48f42378cf85d9bc5
LinuxLinux6.11, 0, 6.11.3
LinuxLinux89c1905d9c140372b7f50ef48f42378cf85d9bc5, 6.11.3, 6.12
linuxlinux_kernel6.11, 6.11

Timeline

  • Oct 21, 2024 CVE Published
  • Oct 22, 2024 EPSS Score (30 in total, the first dated here)
  • Oct 22, 2024 Coalition ESS Score (7 in total, the first dated here)
  • Oct 24, 2024 CVE Updated
  • Jan 2, 2026 Security Advisory (425 in total, the first dated here)
  • Apr 29, 2026 Distribution Patch (358 in total, the first dated here)

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2024-49873
vulnetix vdb fixes CVE-2024-49873

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-49873/fixes/registry"

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

References

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