{"id":"CVE-2026-138832","summary":"mm/madvise: reclaim isolated folios if PTE restart fails","details":"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.","modified":"2026-12-01T21:02:33.323667510Z","published":"2026-11-30T13:25:24.002Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138832.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/06eebc180008290a042403e66fff2e80542c99a0"},{"type":"WEB","url":"https://git.kernel.org/stable/c/380fbb3a43228a3f439d64549a9d854a23d336b8"},{"type":"WEB","url":"https://git.kernel.org/stable/c/52202745c8b3835119f4f6d00060df416e49b329"},{"type":"WEB","url":"https://git.kernel.org/stable/c/5445a6359d717354dd76d509b8e693f13403ec61"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138832.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138832"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"b2f557a21bc8fffdcd65794eda8a854e024999f3"},{"fixed":"52202745c8b3835119f4f6d00060df416e49b329"},{"fixed":"06eebc180008290a042403e66fff2e80542c99a0"},{"fixed":"380fbb3a43228a3f439d64549a9d854a23d336b8"},{"fixed":"5445a6359d717354dd76d509b8e693f13403ec61"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138832.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.117"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.63"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138832.json"}}],"schema_version":"1.9.2"}