{"api_version":"1","generated_at":"2026-11-30T14:49:38+00:00","cve":"CVE-2026-138862","urls":{"html":"https://cve.report/CVE-2026-138862","api":"https://cve.report/api/cve/CVE-2026-138862.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-138862","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-138862"},"summary":{"title":"mm/mempolicy: use vm_normal_folio_pmd() in queue_folios_pmd()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/mempolicy: use vm_normal_folio_pmd() in queue_folios_pmd()\n\nPatch series \"mm: stop calling pmd_folio() on special PMDs\", v3.\n\nTwo page table walkers resolve the folio behind a PMD with pmd_folio(),\nwhich is only valid for a PMD mapping a refcounted struct page:\n\n  madvise_cold_or_pageout_pte_range() mm/madvise.c\n  queue_folios_pmd() mm/mempolicy.c\n\nvmf_insert_pfn_pmd() installs special PMDs holding a raw pfn that need not\nhave a memmap entry at all.  Both walkers can reach one and fault on the\nfirst folio field read.  The PTE halves of both already use\nvm_normal_folio(); these two patches make the PMD halves match.\n\nThe four callers of vmf_insert_pfn_pmd(), and which walker each reaches:\n\n  drivers/vfio/pci/vfio_pci_core.c        VM_PFNMAP     mempolicy\n  drivers/gpu/drm/drm_gem_shmem_helper.c  VM_PFNMAP     mempolicy\n  drivers/gpu/drm/panthor/panthor_gem.c   VM_PFNMAP     mempolicy\n  drivers/hv/mshv_vtl_main.c              VM_MIXEDMAP   both\n\ncan_madv_lru_vma() rejects VM_PFNMAP, so only mshv_vtl_low reaches the\nmadvise walker, and that needs CAP_SYS_ADMIN.  queue_pages_walk_ops\nsupplies its own ->test_walk, so walk_page_test()'s generic VM_PFNMAP skip\nnever runs and vfio-pci is reachable by any process holding the device fd.\nHence the different stable tags.\n\nOne behaviour change: mbind(MPOL_MF_STRICT) over a PMD mapped VM_PFNMAP\nregion now returns 0 rather than -EIO.  The PTE loop already returned 0\nthere.  drm_gem_shmem and panthor are where this is observable, since they\nPMD map pages that do have a memmap entry and so never faulted.\n\nReproducer\n==========\n\nNo hardware needed.  An out of tree module stands in for the drivers\nabove: three misc devices, each with a ->huge_fault calling\nvmf_insert_pfn_pmd(), plus VM_HUGEPAGE so the fault path takes the PMD\nbranch.\n\n  /dev/pmdspec_mixed    VM_MIXEDMAP, pfn at the 1 TiB mark, no memmap\n  /dev/pmdspec_pfnmap   VM_PFNMAP,   pfn at the 1 TiB mark, no memmap\n  /dev/pmdspec_real     VM_PFNMAP,   real alloc_pages(PMD_ORDER) on node 0\n\nUserspace maps the device into a PMD aligned window, reads one byte to\nfault the PMD in, checks a module parameter to confirm it went in, then\nissues the operation.\n\n  vng --run <bzImage> --user root --memory 4G --verbose \\\n      --append \"numa=fake=2\" \\\n      --exec \"insmod pmdspec.ko && ./pmdspec_test <subtest>\"\n\nnuma=fake=2 gives a node 1 to bind to; the module allocates its real page\non node 0, which is what makes queue_folio_required() true.\n\n  subtest        operation                              parent   series\n  --------------------------------------------------------------------\n  madv_cold      madvise(MADV_COLD)                     oops     ret=0\n  madv_pageout   madvise(MADV_PAGEOUT)                  oops     ret=0\n  mbind_mixed    mbind(MPOL_BIND, n1, MPOL_MF_MOVE)     oops     ret=0\n  mbind_pfnmap   mbind(MPOL_BIND, n1, MPOL_MF_STRICT)   oops     ret=0\n  mbind_real     mbind(MPOL_BIND, n1, MPOL_MF_STRICT)   -EIO     ret=0\n\nTwo things the table shows that are easy to miss in the code:\n\n  - mbind_mixed passes only MPOL_MF_MOVE.  MPOL_MF_STRICT is not needed for\n    a VM_MIXEDMAP vma: walk_page_test() only skips VM_PFNMAP, and\n    vma_migratable() is true for VM_MIXEDMAP.\n\n  - mbind_real demonstrates the user visible change (-EIO -> 0)\n\n\nThis patch (of 2):\n\nmmap a VM_PFNMAP region whose ->huge_fault installs a PMD through\nvmf_insert_pfn_pmd() - a vfio-pci MMIO BAR does this - then\n\n\tmbind(p, len, MPOL_BIND, &mask, maxnode, MPOL_MF_STRICT);\n\nWith a stand-in module for the driver:\n\n  BUG: unable to handle page fault for address: fffff96dc0000008\n  RIP: 0010:queue_folios_pte_range+0xaf/0x440\n   walk_pgd_range+0x52b/0xaf0\n   __walk_page_range+0x6a/0x1d0\n   walk_page_range_mm_unsafe+0x193/0x230\n   queue_pages_range+0x64/0xa0\n   do_mbind+0x25e/0x640\n\nqueue_folios_pmd(), inlined above, calls pmd_folio() on that PMD.  The pfn\nis raw MMIO with no memmap entry, so\n---truncated---","state":"PUBLISHED","assigner":"Linux","published_at":"2026-11-30 14:17:42","updated_at":"2026-11-30 14:17:42"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/5e3097e128cd92ac663849164af18220cf12eb0f","name":"https://git.kernel.org/stable/c/5e3097e128cd92ac663849164af18220cf12eb0f","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/8565957d9047029904b7541ba87f08a9e860b59e","name":"https://git.kernel.org/stable/c/8565957d9047029904b7541ba87f08a9e860b59e","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/2e10d5209d83196d1800a8199e69139454c298a4","name":"https://git.kernel.org/stable/c/2e10d5209d83196d1800a8199e69139454c298a4","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/9057170a941f0c5f4058f6fb9ab5d5fc9fcc9e83","name":"https://git.kernel.org/stable/c/9057170a941f0c5f4058f6fb9ab5d5fc9fcc9e83","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-138862","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138862","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 3c8e44c9b369b3d422516b3f2bf47a6e3c61d1ea 5e3097e128cd92ac663849164af18220cf12eb0f git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 3c8e44c9b369b3d422516b3f2bf47a6e3c61d1ea 2e10d5209d83196d1800a8199e69139454c298a4 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 3c8e44c9b369b3d422516b3f2bf47a6e3c61d1ea 8565957d9047029904b7541ba87f08a9e860b59e git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 3c8e44c9b369b3d422516b3f2bf47a6e3c61d1ea 9057170a941f0c5f4058f6fb9ab5d5fc9fcc9e83 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 6.12","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.12 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.12.118 6.12.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.64 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.4 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["mm/mempolicy.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"5e3097e128cd92ac663849164af18220cf12eb0f","status":"affected","version":"3c8e44c9b369b3d422516b3f2bf47a6e3c61d1ea","versionType":"git"},{"lessThan":"2e10d5209d83196d1800a8199e69139454c298a4","status":"affected","version":"3c8e44c9b369b3d422516b3f2bf47a6e3c61d1ea","versionType":"git"},{"lessThan":"8565957d9047029904b7541ba87f08a9e860b59e","status":"affected","version":"3c8e44c9b369b3d422516b3f2bf47a6e3c61d1ea","versionType":"git"},{"lessThan":"9057170a941f0c5f4058f6fb9ab5d5fc9fcc9e83","status":"affected","version":"3c8e44c9b369b3d422516b3f2bf47a6e3c61d1ea","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["mm/mempolicy.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"6.12"},{"lessThan":"6.12","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"6.12.*","status":"unaffected","version":"6.12.118","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.64","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.4","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.12.118","versionStartIncluding":"6.12","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.64","versionStartIncluding":"6.12","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.4","versionStartIncluding":"6.12","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc1","versionStartIncluding":"6.12","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/mempolicy: use vm_normal_folio_pmd() in queue_folios_pmd()\n\nPatch series \"mm: stop calling pmd_folio() on special PMDs\", v3.\n\nTwo page table walkers resolve the folio behind a PMD with pmd_folio(),\nwhich is only valid for a PMD mapping a refcounted struct page:\n\n  madvise_cold_or_pageout_pte_range() mm/madvise.c\n  queue_folios_pmd() mm/mempolicy.c\n\nvmf_insert_pfn_pmd() installs special PMDs holding a raw pfn that need not\nhave a memmap entry at all.  Both walkers can reach one and fault on the\nfirst folio field read.  The PTE halves of both already use\nvm_normal_folio(); these two patches make the PMD halves match.\n\nThe four callers of vmf_insert_pfn_pmd(), and which walker each reaches:\n\n  drivers/vfio/pci/vfio_pci_core.c        VM_PFNMAP     mempolicy\n  drivers/gpu/drm/drm_gem_shmem_helper.c  VM_PFNMAP     mempolicy\n  drivers/gpu/drm/panthor/panthor_gem.c   VM_PFNMAP     mempolicy\n  drivers/hv/mshv_vtl_main.c              VM_MIXEDMAP   both\n\ncan_madv_lru_vma() rejects VM_PFNMAP, so only mshv_vtl_low reaches the\nmadvise walker, and that needs CAP_SYS_ADMIN.  queue_pages_walk_ops\nsupplies its own ->test_walk, so walk_page_test()'s generic VM_PFNMAP skip\nnever runs and vfio-pci is reachable by any process holding the device fd.\nHence the different stable tags.\n\nOne behaviour change: mbind(MPOL_MF_STRICT) over a PMD mapped VM_PFNMAP\nregion now returns 0 rather than -EIO.  The PTE loop already returned 0\nthere.  drm_gem_shmem and panthor are where this is observable, since they\nPMD map pages that do have a memmap entry and so never faulted.\n\nReproducer\n==========\n\nNo hardware needed.  An out of tree module stands in for the drivers\nabove: three misc devices, each with a ->huge_fault calling\nvmf_insert_pfn_pmd(), plus VM_HUGEPAGE so the fault path takes the PMD\nbranch.\n\n  /dev/pmdspec_mixed    VM_MIXEDMAP, pfn at the 1 TiB mark, no memmap\n  /dev/pmdspec_pfnmap   VM_PFNMAP,   pfn at the 1 TiB mark, no memmap\n  /dev/pmdspec_real     VM_PFNMAP,   real alloc_pages(PMD_ORDER) on node 0\n\nUserspace maps the device into a PMD aligned window, reads one byte to\nfault the PMD in, checks a module parameter to confirm it went in, then\nissues the operation.\n\n  vng --run <bzImage> --user root --memory 4G --verbose \\\n      --append \"numa=fake=2\" \\\n      --exec \"insmod pmdspec.ko && ./pmdspec_test <subtest>\"\n\nnuma=fake=2 gives a node 1 to bind to; the module allocates its real page\non node 0, which is what makes queue_folio_required() true.\n\n  subtest        operation                              parent   series\n  --------------------------------------------------------------------\n  madv_cold      madvise(MADV_COLD)                     oops     ret=0\n  madv_pageout   madvise(MADV_PAGEOUT)                  oops     ret=0\n  mbind_mixed    mbind(MPOL_BIND, n1, MPOL_MF_MOVE)     oops     ret=0\n  mbind_pfnmap   mbind(MPOL_BIND, n1, MPOL_MF_STRICT)   oops     ret=0\n  mbind_real     mbind(MPOL_BIND, n1, MPOL_MF_STRICT)   -EIO     ret=0\n\nTwo things the table shows that are easy to miss in the code:\n\n  - mbind_mixed passes only MPOL_MF_MOVE.  MPOL_MF_STRICT is not needed for\n    a VM_MIXEDMAP vma: walk_page_test() only skips VM_PFNMAP, and\n    vma_migratable() is true for VM_MIXEDMAP.\n\n  - mbind_real demonstrates the user visible change (-EIO -> 0)\n\n\nThis patch (of 2):\n\nmmap a VM_PFNMAP region whose ->huge_fault installs a PMD through\nvmf_insert_pfn_pmd() - a vfio-pci MMIO BAR does this - then\n\n\tmbind(p, len, MPOL_BIND, &mask, maxnode, MPOL_MF_STRICT);\n\nWith a stand-in module for the driver:\n\n  BUG: unable to handle page fault for address: fffff96dc0000008\n  RIP: 0010:queue_folios_pte_range+0xaf/0x440\n   walk_pgd_range+0x52b/0xaf0\n   __walk_page_range+0x6a/0x1d0\n   walk_page_range_mm_unsafe+0x193/0x230\n   queue_pages_range+0x64/0xa0\n   do_mbind+0x25e/0x640\n\nqueue_folios_pmd(), inlined above, calls pmd_folio() on that PMD.  The pfn\nis raw MMIO with no memmap entry, so\n---truncated---"}],"providerMetadata":{"dateUpdated":"2026-11-30T13:25:40.779Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/5e3097e128cd92ac663849164af18220cf12eb0f"},{"url":"https://git.kernel.org/stable/c/2e10d5209d83196d1800a8199e69139454c298a4"},{"url":"https://git.kernel.org/stable/c/8565957d9047029904b7541ba87f08a9e860b59e"},{"url":"https://git.kernel.org/stable/c/9057170a941f0c5f4058f6fb9ab5d5fc9fcc9e83"}],"title":"mm/mempolicy: use vm_normal_folio_pmd() in queue_folios_pmd()","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-138862","datePublished":"2026-11-30T13:25:40.779Z","dateReserved":"2026-11-30T13:22:15.899Z","dateUpdated":"2026-11-30T13:25:40.779Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-11-30 14:17:42","lastModifiedDate":"2026-11-30 14:17:42","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"138862","Ordinal":"1","Title":"mm/mempolicy: use vm_normal_folio_pmd() in queue_folios_pmd()","CVE":"CVE-2026-138862","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"138862","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/mempolicy: use vm_normal_folio_pmd() in queue_folios_pmd()\n\nPatch series \"mm: stop calling pmd_folio() on special PMDs\", v3.\n\nTwo page table walkers resolve the folio behind a PMD with pmd_folio(),\nwhich is only valid for a PMD mapping a refcounted struct page:\n\n  madvise_cold_or_pageout_pte_range() mm/madvise.c\n  queue_folios_pmd() mm/mempolicy.c\n\nvmf_insert_pfn_pmd() installs special PMDs holding a raw pfn that need not\nhave a memmap entry at all.  Both walkers can reach one and fault on the\nfirst folio field read.  The PTE halves of both already use\nvm_normal_folio(); these two patches make the PMD halves match.\n\nThe four callers of vmf_insert_pfn_pmd(), and which walker each reaches:\n\n  drivers/vfio/pci/vfio_pci_core.c        VM_PFNMAP     mempolicy\n  drivers/gpu/drm/drm_gem_shmem_helper.c  VM_PFNMAP     mempolicy\n  drivers/gpu/drm/panthor/panthor_gem.c   VM_PFNMAP     mempolicy\n  drivers/hv/mshv_vtl_main.c              VM_MIXEDMAP   both\n\ncan_madv_lru_vma() rejects VM_PFNMAP, so only mshv_vtl_low reaches the\nmadvise walker, and that needs CAP_SYS_ADMIN.  queue_pages_walk_ops\nsupplies its own ->test_walk, so walk_page_test()'s generic VM_PFNMAP skip\nnever runs and vfio-pci is reachable by any process holding the device fd.\nHence the different stable tags.\n\nOne behaviour change: mbind(MPOL_MF_STRICT) over a PMD mapped VM_PFNMAP\nregion now returns 0 rather than -EIO.  The PTE loop already returned 0\nthere.  drm_gem_shmem and panthor are where this is observable, since they\nPMD map pages that do have a memmap entry and so never faulted.\n\nReproducer\n==========\n\nNo hardware needed.  An out of tree module stands in for the drivers\nabove: three misc devices, each with a ->huge_fault calling\nvmf_insert_pfn_pmd(), plus VM_HUGEPAGE so the fault path takes the PMD\nbranch.\n\n  /dev/pmdspec_mixed    VM_MIXEDMAP, pfn at the 1 TiB mark, no memmap\n  /dev/pmdspec_pfnmap   VM_PFNMAP,   pfn at the 1 TiB mark, no memmap\n  /dev/pmdspec_real     VM_PFNMAP,   real alloc_pages(PMD_ORDER) on node 0\n\nUserspace maps the device into a PMD aligned window, reads one byte to\nfault the PMD in, checks a module parameter to confirm it went in, then\nissues the operation.\n\n  vng --run <bzImage> --user root --memory 4G --verbose \\\n      --append \"numa=fake=2\" \\\n      --exec \"insmod pmdspec.ko && ./pmdspec_test <subtest>\"\n\nnuma=fake=2 gives a node 1 to bind to; the module allocates its real page\non node 0, which is what makes queue_folio_required() true.\n\n  subtest        operation                              parent   series\n  --------------------------------------------------------------------\n  madv_cold      madvise(MADV_COLD)                     oops     ret=0\n  madv_pageout   madvise(MADV_PAGEOUT)                  oops     ret=0\n  mbind_mixed    mbind(MPOL_BIND, n1, MPOL_MF_MOVE)     oops     ret=0\n  mbind_pfnmap   mbind(MPOL_BIND, n1, MPOL_MF_STRICT)   oops     ret=0\n  mbind_real     mbind(MPOL_BIND, n1, MPOL_MF_STRICT)   -EIO     ret=0\n\nTwo things the table shows that are easy to miss in the code:\n\n  - mbind_mixed passes only MPOL_MF_MOVE.  MPOL_MF_STRICT is not needed for\n    a VM_MIXEDMAP vma: walk_page_test() only skips VM_PFNMAP, and\n    vma_migratable() is true for VM_MIXEDMAP.\n\n  - mbind_real demonstrates the user visible change (-EIO -> 0)\n\n\nThis patch (of 2):\n\nmmap a VM_PFNMAP region whose ->huge_fault installs a PMD through\nvmf_insert_pfn_pmd() - a vfio-pci MMIO BAR does this - then\n\n\tmbind(p, len, MPOL_BIND, &mask, maxnode, MPOL_MF_STRICT);\n\nWith a stand-in module for the driver:\n\n  BUG: unable to handle page fault for address: fffff96dc0000008\n  RIP: 0010:queue_folios_pte_range+0xaf/0x440\n   walk_pgd_range+0x52b/0xaf0\n   __walk_page_range+0x6a/0x1d0\n   walk_page_range_mm_unsafe+0x193/0x230\n   queue_pages_range+0x64/0xa0\n   do_mbind+0x25e/0x640\n\nqueue_folios_pmd(), inlined above, calls pmd_folio() on that PMD.  The pfn\nis raw MMIO with no memmap entry, so\n---truncated---","Type":"Description","Title":"mm/mempolicy: use vm_normal_folio_pmd() in queue_folios_pmd()"}]}}}