CVE-2026-138832

mm/madvise: reclaim isolated folios if PTE restart fails

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

mm/madvise: reclaim isolated folios if PTE restart fails

MADV_PAGEOUT collects isolated folios on a local list before reclaiming
them after the PTE walk. The reschedule path drops the PTE lock and then
restarts the mapping with pte_offset_map_lock().

A concurrent operation can remove or replace the PTE table while the lock
is dropped, causing pte_offset_map_lock() to return NULL. Returning
directly in that case bypasses reclaim_pages(), leaving the collected
folios off the LRU with elevated references.

This results in a permanent memory leak. nr_isolated_anon increases
reliably and does not decrease when the process dies.

Route the failure through the existing cleanup path so any isolated folios
are reclaimed or put back.

Simplest userland pseudo-code reproducer:

p = mmap(PMD_SIZE, ANONYMOUS);
touch_every_page(p, PMD_SIZE);
parallel {
while (1) madvise(p, PMD_SIZE, MADV_PAGEOUT);
while (1) {
madvise(p, PMD_SIZE, MADV_DONTNEED);
touch_every_page(p, PMD_SIZE);
}
}

Reproduced in qemu trivially with some explicit widening of the race window.

Analysis

AI-generated

Technical impact

The vulnerability originates in the Linux kernel's memory manager: when the MADV_PAGEOUT advice is invoked, the kernel collects isolated folios on a local list and later attempts to reclaim them. If a concurrent task disrupts the page table entries (PTE) while the PTE lock is briefly released, the kernel’s retry mechanism fails and returns NULL. This bypasses the reclaim logic, leaving the isolated folios off the LRU list with elevated reference counts. The result is a permanent memory leak that causes the nr_isolated_anon counter to grow continuously, eventually exhausting available memory and collapsing system performance or causing a crash.

Affected Systems

All Linux kernel builds that contain the vulnerable mm/madvise handling code are impacted, as no specific release version is identified in the advisory. The flaw exists in the default kernel sources until the patch is applied. System administrators should assume that any kernel older than the fix is susceptible until verified otherwise.

Risk and Exploitability

Because the flaw requires concurrent use of madvise actions from a local process (MADV_PAGEOUT and MADV_DONTNEED) to trigger the race, the vector is local to the system. No public exploit is documented and the EPSS score is not available, but the impact of a sustained leak is significant: runaway memory usage can lead to denial of service. The kernel does not contain additional checks to mitigate the race, and the bug was not listed in CISA’s KEV catalog, suggesting no currently known active exploitation. Nevertheless, the severity of the resulting resource starvation warrants immediate attention.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the kernel to a release that contains the applied patch for the mm/madvise memory management code.
  • If an immediate kernel upgrade is not viable, restrict or serialize the use of MADV_PAGEOUT and MADV_DONTNEED to prevent concurrent invocations that could create the race condition.
  • Continuously monitor kernel memory usage, specifically the nr_isolated_anon counter, and set alerts for abnormal growth to detect potential leaks early.

Generated by OpenCVE AI on November 30, 2026 at 17:22 UTC.

Tracking

Sign in to view the affected projects.

Exploits

Explore public exploit intelligence with OpenCVE Pro.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-362
CWE-399
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: mm/madvise: reclaim isolated folios if PTE restart fails MADV_PAGEOUT collects isolated folios on a local list before reclaiming them after the PTE walk. The reschedule path drops the PTE lock and then restarts the mapping with pte_offset_map_lock(). A concurrent operation can remove or replace the PTE table while the lock is dropped, causing pte_offset_map_lock() to return NULL. Returning directly in that case bypasses reclaim_pages(), leaving the collected folios off the LRU with elevated references. This results in a permanent memory leak. nr_isolated_anon increases reliably and does not decrease when the process dies. Route the failure through the existing cleanup path so any isolated folios are reclaimed or put back. Simplest userland pseudo-code reproducer: p = mmap(PMD_SIZE, ANONYMOUS); touch_every_page(p, PMD_SIZE); parallel { while (1) madvise(p, PMD_SIZE, MADV_PAGEOUT); while (1) { madvise(p, PMD_SIZE, MADV_DONTNEED); touch_every_page(p, PMD_SIZE); } } Reproduced in qemu trivially with some explicit widening of the race window.
Title mm/madvise: reclaim isolated folios if PTE restart fails
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-362

    Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

  • CWE-399

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:25 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:17 PM
Modified
Nov 30, 2026, 2:17 PM