# CVE-2024-40950: linux: In the Linux kernel, the following vulnerability has been resolved:  mm: huge_memory: fix misused mapping_large_folio...

CVE-2024-40950 is fixed in linux on 1 platform, first by DEBIAN-CVE-2024-40950, released July 12, 2024. It is not reported as exploited. Patch Radar priority: Routine.

- Web page: https://patchblox.com/security/cve/CVE-2024-40950
- Priority: Routine
- CVSS: 5.5 (medium)
- EPSS: 0.0021
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Jul 12, 2024

## Description

In the Linux kernel, the following vulnerability has been resolved:  mm: huge_memory: fix misused mapping_large_folio_support() for anon folios  When I did a large folios split test, a WARNING "[ 5059.122759][ T166] Cannot split file folio to non-0 order" was triggered.  But the test cases are only for anonmous folios.  while mapping_large_folio_support() is only reasonable for page cache folios.  In split_huge_page_to_list_to_order(), the folio passed to mapping_large_folio_support() maybe anonmous folio.  The folio_test_anon() check is missing.  So the split of the anonmous THP is failed.  This is also the same for shmem_mapping().  We'd better add a check for both.  But the shmem_mapping() in __split_huge_page() is not involved, as for anonmous folios, the end parameter is set to -1, so (head[i].index >= end) is always false.  shmem_mapping() is not called.  Also add a VM_WARN_ON_ONCE() in mapping_large_folio_support() for anon mapping, So we can detect the wrong use more easily.  THP folios maybe exist in the pagecache even the file system doesn't support large folio, it is because when CONFIG_TRANSPARENT_HUGEPAGE is enabled, khugepaged will try to collapse read-only file-backed pages to THP.  But the mapping does not actually support multi order large folios properly.  Using /sys/kernel/debug/split_huge_pages to verify this, with this patch, large anon THP is successfully split and the warning is ceased.

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | linux Debian 13.5 (trixie) | 6.9.7-1 | [DEBIAN-CVE-2024-40950](https://patchblox.com/security/data/fix/linux/debian-cve-2024-40950.md) | Jul 12, 2024 |
| Linux | linux Debian 14 | 6.9.7-1 | [DEBIAN-CVE-2024-40950](https://patchblox.com/security/data/fix/linux/debian-cve-2024-40950.md) | Jul 12, 2024 |

---

Data as of 2026-11-08T00:53:09Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
