{"id":"CVE-2026-138832","aliases":["CVE-2026-138832"],"related":[],"kind":"vulnerability","state":"published","title":"mm/madvise: reclaim isolated folios if PTE restart fails","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/madvise: reclaim isolated folios if PTE restart fails\n\nMADV_PAGEOUT collects isolated folios on a local list before reclaiming\nthem after the PTE walk.  The reschedule path drops the PTE lock and then\nrestarts the mapping with pte_offset_map_lock().\n\nA concurrent operation can remove or replace the PTE table while the lock\nis dropped, causing pte_offset_map_lock() to return NULL.  Returning\ndirectly in that case bypasses reclaim_pages(), leaving the collected\nfolios off the LRU with elevated references.\n\nThis results in a permanent memory leak.  nr_isolated_anon increases\nreliably and does not decrease when the process dies.\n\nRoute the failure through the existing cleanup path so any isolated folios\nare reclaimed or put back.\n\nSimplest userland pseudo-code reproducer:\n\np = mmap(PMD_SIZE, ANONYMOUS);\ntouch_every_page(p, PMD_SIZE);\nparallel {\n   while (1) madvise(p, PMD_SIZE, MADV_PAGEOUT);\n   while (1) {\n       madvise(p, PMD_SIZE, MADV_DONTNEED);\n       touch_every_page(p, PMD_SIZE);\n   }\n}\n\nReproduced in qemu trivially with some explicit widening of the race window.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/madvise: reclaim isolated folios if PTE restart fails\n\nMADV_PAGEOUT collects isolated folios on a local list before reclaiming\nthem after the PTE walk.  The reschedule path drops the PTE lock and then\nrestarts the mapping with pte_offset_map_lock().\n\nA concurrent operation can remove or replace the PTE table while the lock\nis dropped, causing pte_offset_map_lock() to return NULL.  Returning\ndirectly in that case bypasses reclaim_pages(), leaving the collected\nfolios off the LRU with elevated references.\n\nThis results in a permanent memory leak.  nr_isolated_anon increases\nreliably and does not decrease when the process dies.\n\nRoute the failure through the existing cleanup path so any isolated folios\nare reclaimed or put back.\n\nSimplest userland pseudo-code reproducer:\n\np = mmap(PMD_SIZE, ANONYMOUS);\ntouch_every_page(p, PMD_SIZE);\nparallel {\n   while (1) madvise(p, PMD_SIZE, MADV_PAGEOUT);\n   while (1) {\n       madvise(p, PMD_SIZE, MADV_DONTNEED);\n       touch_every_page(p, PMD_SIZE);\n   }\n}\n\nReproduced in qemu trivially with some explicit widening of the race window.","source":"cvelist"}],"published":"2026-11-30T13:25:24.002Z","modified":"2026-11-30T14:17:37.613Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"b2f557a21bc8fffdcd65794eda8a854e024999f3","fixed":"52202745c8b3835119f4f6d00060df416e49b329","status":"affected"},{"type":"git","introduced":"b2f557a21bc8fffdcd65794eda8a854e024999f3","fixed":"06eebc180008290a042403e66fff2e80542c99a0","status":"affected"},{"type":"git","introduced":"b2f557a21bc8fffdcd65794eda8a854e024999f3","fixed":"380fbb3a43228a3f439d64549a9d854a23d336b8","status":"affected"},{"type":"git","introduced":"b2f557a21bc8fffdcd65794eda8a854e024999f3","fixed":"5445a6359d717354dd76d509b8e693f13403ec61","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.7","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.7","status":"unaffected"},{"type":"semver","introduced":"6.12.117","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.63","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.4","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/52202745c8b3835119f4f6d00060df416e49b329","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/06eebc180008290a042403e66fff2e80542c99a0","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/380fbb3a43228a3f439d64549a9d854a23d336b8","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5445a6359d717354dd76d509b8e693f13403ec61","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-138832","url":"https://www.cve.org/CVERecord?id=CVE-2026-138832","licence":"CVE Terms of Use","modified":"2026-11-30T13:25:24.002Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-138832","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138832","licence":"Public domain","modified":"2026-11-30T14:17:37.613Z"}],"updatedAt":"2026-11-30T14:32:34.812Z","epss":{"score":0.00184,"percentile":0.08412,"date":"2026-12-01T12:00:22.000Z"}}