PT-2026-162722
CVE-2026-138862
·
تاريخ النشر
2026-11-30
·
تاريخ التحديث
2026-11-30
الوصف من
الدرجة
N/A
غير متوفرلا تتوفر حاليًا تقييمات أو مقاييس للخطورة. سنحدّث المعلومات المقابلة في الصفحة فور توفرها.
In the Linux kernel, the following vulnerability has been resolved:
mm/mempolicy: use vm normal folio pmd() in queue folios pmd()
Patch series "mm: stop calling pmd folio() on special PMDs", v3.
Two page table walkers resolve the folio behind a PMD with pmd folio(),
which is only valid for a PMD mapping a refcounted struct page:
madvise cold or pageout pte range() mm/madvise.c
queue folios pmd() mm/mempolicy.c
vmf insert pfn pmd() installs special PMDs holding a raw pfn that need not
have a memmap entry at all. Both walkers can reach one and fault on the
first folio field read. The PTE halves of both already use
vm normal folio(); these two patches make the PMD halves match.
The four callers of vmf insert pfn pmd(), and which walker each reaches:
drivers/vfio/pci/vfio pci core.c VM PFNMAP mempolicy
drivers/gpu/drm/drm gem shmem helper.c VM PFNMAP mempolicy
drivers/gpu/drm/panthor/panthor gem.c VM PFNMAP mempolicy
drivers/hv/mshv vtl main.c VM MIXEDMAP both
can madv lru vma() rejects VM PFNMAP, so only mshv vtl low reaches the
madvise walker, and that needs CAP SYS ADMIN. queue pages walk ops
supplies its own ->test walk, so walk page test()'s generic VM PFNMAP skip
never runs and vfio-pci is reachable by any process holding the device fd.
Hence the different stable tags.
One behaviour change: mbind(MPOL MF STRICT) over a PMD mapped VM PFNMAP
region now returns 0 rather than -EIO. The PTE loop already returned 0
there. drm gem shmem and panthor are where this is observable, since they
PMD map pages that do have a memmap entry and so never faulted.
Reproducer
No hardware needed. An out of tree module stands in for the drivers
above: three misc devices, each with a ->huge fault calling
vmf insert pfn pmd(), plus VM HUGEPAGE so the fault path takes the PMD
branch.
/dev/pmdspec mixed VM MIXEDMAP, pfn at the 1 TiB mark, no memmap
/dev/pmdspec pfnmap VM PFNMAP, pfn at the 1 TiB mark, no memmap
/dev/pmdspec real VM PFNMAP, real alloc pages(PMD ORDER) on node 0
Userspace maps the device into a PMD aligned window, reads one byte to
fault the PMD in, checks a module parameter to confirm it went in, then
issues the operation.
vng --run --user root --memory 4G --verbose
--append "numa=fake=2"
--exec "insmod pmdspec.ko && ./pmdspec test "
numa=fake=2 gives a node 1 to bind to; the module allocates its real page
on node 0, which is what makes queue folio required() true.
subtest operation parent series
madv cold madvise(MADV COLD) oops ret=0
madv pageout madvise(MADV PAGEOUT) oops ret=0
mbind mixed mbind(MPOL BIND, n1, MPOL MF MOVE) oops ret=0
mbind pfnmap mbind(MPOL BIND, n1, MPOL MF STRICT) oops ret=0
mbind real mbind(MPOL BIND, n1, MPOL MF STRICT) -EIO ret=0
Two things the table shows that are easy to miss in the code:
-
mbind mixed passes only MPOL MF MOVE. MPOL MF STRICT is not needed for a VM MIXEDMAP vma: walk page test() only skips VM PFNMAP, and vma migratable() is true for VM MIXEDMAP.
-
mbind real demonstrates the user visible change (-EIO -> 0)
This patch (of 2):
mmap a VM PFNMAP region whose ->huge fault installs a PMD through
vmf insert pfn pmd() - a vfio-pci MMIO BAR does this - then
mbind(p, len, MPOL BIND, &mask, maxnode, MPOL MF STRICT);With a stand-in module for the driver:
BUG: unable to handle page fault for address: fffff96dc0000008
RIP: 0010:queue folios pte range+0xaf/0x440
walk pgd range+0x52b/0xaf0
walk page range+0x6a/0x1d0
walk page range mm unsafe+0x193/0x230
queue pages range+0x64/0xa0
do mbind+0x25e/0x640
queue folios pmd(), inlined above, calls pmd folio() on that PMD. The pfn
is raw MMIO with no memmap entry, so
---truncated---
وجدت خطأً في الوصف؟ لديك ما تضيفه؟ لا تتردد في مراسلتنا 👾