{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2024-40950","id":"CVE-2024-40950","title":"mm: huge_memory: fix misused mapping_large_folio_support() for anon folios","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm: huge_memory: fix misused mapping_large_folio_support() for anon folios\n\nWhen I did a large folios split test, a WARNING \"[ 5059.122759][ T166]\nCannot split file folio to non-0 order\" was triggered.  But the test cases\nare only for anonmous folios.  while mapping_large_folio_support() is only\nreasonable for page cache folios.\n","descriptionLong":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm: huge_memory: fix misused mapping_large_folio_support() for anon folios\n\nWhen I did a large folios split test, a WARNING \"[ 5059.122759][ T166]\nCannot split file folio to non-0 order\" was triggered.  But the test cases\nare only for anonmous folios.  while mapping_large_folio_support() is only\nreasonable for page cache folios.\n\nIn split_huge_page_to_list_to_order(), the folio passed to\nmapping_large_folio_support() maybe anonmous folio.  The folio_test_anon()\ncheck is missing.  So the split of the anonmous THP is failed.  This is\nalso the same for shmem_mapping().  We'd better add a check for both.  But\nthe shmem_mapping() in __split_huge_page() is not involved, as for\nanonmous folios, the end parameter is set to -1, so (head[i].index >= end)\nis always false.  shmem_mapping() is not called.\n\nAlso add a VM_WARN_ON_ONCE() in mapping_large_folio_support() for anon\nmapping, So we can detect the wrong use more easily.\n\nTHP folios maybe exist in the pagecache even the file system doesn't\nsupport large folio, it is because when CONFIG_TRANSPARENT_HUGEPAGE is\nenabled, khugepaged will try to collapse read-only file-backed pages to\nTHP.  But the mapping does not actually support multi order large folios\nproperly.\n\nUsing /sys/kernel/debug/split_huge_pages to verify this, with this patch,\nlarge anon THP is successfully split and the warning is ceased.","published":"2024-07-12T12:31:54.815Z","updated":"2026-10-28T02:30:54.259057837Z","reserved":"2024-07-12T12:17:45.591Z","status":"Analyzed","rejected":false,"assigner":"Linux","metric":{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"NVD"},"metrics":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"NVD"}],"rating":"medium","products":["Linux"],"affectedProducts":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"c010d47f107f609b9f4d6a103b6dfc53889049e9","lessThan":"5df493a99fcf887133cf01d23cd4bebb6d385d3c","status":"affected","versionType":"git"},{"version":"c010d47f107f609b9f4d6a103b6dfc53889049e9","lessThan":"6a50c9b512f7734bc356f4bd47885a6f7c98491a","status":"affected","versionType":"git"}],"platforms":[]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.9","status":"affected"},{"version":"0","lessThan":"6.9","status":"unaffected","versionType":"semver"},{"version":"6.9.7","lessThanOrEqual":"6.9.*","status":"unaffected","versionType":"semver"},{"version":"6.10","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}],"platforms":[]}],"packages":[],"cwes":[],"aliases":[],"references":[{"url":"https://git.kernel.org/stable/c/5df493a99fcf887133cf01d23cd4bebb6d385d3c","tags":["x_transferred","Patch","web"]},{"url":"https://git.kernel.org/stable/c/6a50c9b512f7734bc356f4bd47885a6f7c98491a","tags":["x_transferred","Patch","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/40xxx/CVE-2024-40950.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-40950","tags":["advisory"]},{"url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial"},"epss":0.00208,"epssPercentile":0.10968,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2024-40950","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-40950","ok":true,"note":"Analyzed"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2024-40950","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2024-40950","ok":true,"note":"scored 2026-11-18"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}