{"api_version":"1","generated_at":"2026-09-17T14:27:18+00:00","cve":"CVE-2026-89987","urls":{"html":"https://cve.report/CVE-2026-89987","api":"https://cve.report/api/cve/CVE-2026-89987.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-89987","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-89987"},"summary":{"title":"mm/huge_memory: transfer the pmd dirty bit to the folio on zap","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/huge_memory: transfer the pmd dirty bit to the folio on zap\n\nzap_huge_pmd_folio() propagates the pmd young bit to the folio for the\nfile case, but not the dirty bit.  The pte path does propagate it, in\nzap_present_folio_ptes() and so does the pmd split path, in\n__split_huge_pmd_locked().\n\nFor most file mappings the omission is harmless, because writing to a\nshared file mapping goes through page_mkwrite(), which dirties the folio. \ntmpfs is different: it has no page_mkwrite(), and vma_wants_writenotify()\nis false for it, so a *read* fault on a MAP_SHARED tmpfs mapping installs\na writable pmd via do_read_fault().  do_read_fault() does not call\nfault_dirty_shared_page(), so subsequent stores through that mapping set\nonly the hardware dirty bit in the pmd and never call folio_mark_dirty(). \nA shmem folio allocated by a fault is marked uptodate but not dirty (see\nthe clear: block in shmem_get_folio_gfp()), so PG_dirty is never set at\nall.\n\nUnmapping such a folio - munmap(), or exit_mmap() when the process dies -\nthen loses the only record that it was written, because zap_huge_pmd()\ndrops the pmd without transferring the dirty bit.  Reclaim afterwards sees\na clean shmem folio: the whole swap-out block in shrink_folio_list() is\ninside \"if (folio_test_dirty(folio))\", so pageout() is skipped and the\nfolio falls into __remove_mapping().  There, folio_is_file_lru() is false\nfor a swapbacked folio, so no shadow entry is created and\n__filemap_remove_folio(folio, NULL) simply empties the i_pages slot.  The\ndata is freed without ever being written to swap, and the next fault on\nthat index returns a freshly zeroed folio.\n\nThis is silent data loss for any process that keeps state in a MAP_SHARED\ntmpfs segment across an unmap - for example a cache handed from one\nprocess generation to the next through /dev/shm.  It requires the folio to\nbe PMD-mapped, so it only shows up once shmem THP is enabled (which is\nwhat we did in Meta fleet and started noticing crashes); with THP off the\npte path transfers the dirty bit correctly.  It also only becomes visible\nwhen swap is enabled, because with no swap device shmem folios (which are\non the anon LRU) are not scanned by reclaim at all, so the clean folio is\nnever dropped.\n\nReproduced on x86_64 with a tmpfs mounted huge=within_size: read-fault a\n2MB-backed region, write a known pattern through the resulting mapping,\nmunmap, force reclaim of the cgroup, then re-map and read back.  Without\nthis patch the region reads back as zeros and vmstat shows zswpout 0 - the\ndata was discarded rather than swapped.  With this patch the region reads\nback correctly and the pages are swapped out as expected.  With\nhuge=never, or when the first touch is a write, the test passes either\nway.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-09-16 11:17:09","updated_at":"2026-09-16 11:17:09"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/9435cddf1378d149d826bd7bd1448a44bf96868d","name":"https://git.kernel.org/stable/c/9435cddf1378d149d826bd7bd1448a44bf96868d","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/effe3cc6d4fdd407457eb30f7b0ef094393f0d64","name":"https://git.kernel.org/stable/c/effe3cc6d4fdd407457eb30f7b0ef094393f0d64","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/fe6cf984939d8e12cb33a99673c8d026c5135e68","name":"https://git.kernel.org/stable/c/fe6cf984939d8e12cb33a99673c8d026c5135e68","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-89987","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-89987","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected b5072380eb619786990cd9eab3ade05d09ccd89e effe3cc6d4fdd407457eb30f7b0ef094393f0d64 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected b5072380eb619786990cd9eab3ade05d09ccd89e 9435cddf1378d149d826bd7bd1448a44bf96868d git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected b5072380eb619786990cd9eab3ade05d09ccd89e fe6cf984939d8e12cb33a99673c8d026c5135e68 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 4.8","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 4.8 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.52 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.2.5 7.2.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3-rc2 * 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/huge_memory.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"effe3cc6d4fdd407457eb30f7b0ef094393f0d64","status":"affected","version":"b5072380eb619786990cd9eab3ade05d09ccd89e","versionType":"git"},{"lessThan":"9435cddf1378d149d826bd7bd1448a44bf96868d","status":"affected","version":"b5072380eb619786990cd9eab3ade05d09ccd89e","versionType":"git"},{"lessThan":"fe6cf984939d8e12cb33a99673c8d026c5135e68","status":"affected","version":"b5072380eb619786990cd9eab3ade05d09ccd89e","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["mm/huge_memory.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"4.8"},{"lessThan":"4.8","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.52","versionType":"semver"},{"lessThanOrEqual":"7.2.*","status":"unaffected","version":"7.2.5","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.3-rc2","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.52","versionStartIncluding":"4.8","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.2.5","versionStartIncluding":"4.8","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3-rc2","versionStartIncluding":"4.8","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/huge_memory: transfer the pmd dirty bit to the folio on zap\n\nzap_huge_pmd_folio() propagates the pmd young bit to the folio for the\nfile case, but not the dirty bit.  The pte path does propagate it, in\nzap_present_folio_ptes() and so does the pmd split path, in\n__split_huge_pmd_locked().\n\nFor most file mappings the omission is harmless, because writing to a\nshared file mapping goes through page_mkwrite(), which dirties the folio. \ntmpfs is different: it has no page_mkwrite(), and vma_wants_writenotify()\nis false for it, so a *read* fault on a MAP_SHARED tmpfs mapping installs\na writable pmd via do_read_fault().  do_read_fault() does not call\nfault_dirty_shared_page(), so subsequent stores through that mapping set\nonly the hardware dirty bit in the pmd and never call folio_mark_dirty(). \nA shmem folio allocated by a fault is marked uptodate but not dirty (see\nthe clear: block in shmem_get_folio_gfp()), so PG_dirty is never set at\nall.\n\nUnmapping such a folio - munmap(), or exit_mmap() when the process dies -\nthen loses the only record that it was written, because zap_huge_pmd()\ndrops the pmd without transferring the dirty bit.  Reclaim afterwards sees\na clean shmem folio: the whole swap-out block in shrink_folio_list() is\ninside \"if (folio_test_dirty(folio))\", so pageout() is skipped and the\nfolio falls into __remove_mapping().  There, folio_is_file_lru() is false\nfor a swapbacked folio, so no shadow entry is created and\n__filemap_remove_folio(folio, NULL) simply empties the i_pages slot.  The\ndata is freed without ever being written to swap, and the next fault on\nthat index returns a freshly zeroed folio.\n\nThis is silent data loss for any process that keeps state in a MAP_SHARED\ntmpfs segment across an unmap - for example a cache handed from one\nprocess generation to the next through /dev/shm.  It requires the folio to\nbe PMD-mapped, so it only shows up once shmem THP is enabled (which is\nwhat we did in Meta fleet and started noticing crashes); with THP off the\npte path transfers the dirty bit correctly.  It also only becomes visible\nwhen swap is enabled, because with no swap device shmem folios (which are\non the anon LRU) are not scanned by reclaim at all, so the clean folio is\nnever dropped.\n\nReproduced on x86_64 with a tmpfs mounted huge=within_size: read-fault a\n2MB-backed region, write a known pattern through the resulting mapping,\nmunmap, force reclaim of the cgroup, then re-map and read back.  Without\nthis patch the region reads back as zeros and vmstat shows zswpout 0 - the\ndata was discarded rather than swapped.  With this patch the region reads\nback correctly and the pages are swapped out as expected.  With\nhuge=never, or when the first touch is a write, the test passes either\nway."}],"providerMetadata":{"dateUpdated":"2026-09-16T10:33:02.270Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/effe3cc6d4fdd407457eb30f7b0ef094393f0d64"},{"url":"https://git.kernel.org/stable/c/9435cddf1378d149d826bd7bd1448a44bf96868d"},{"url":"https://git.kernel.org/stable/c/fe6cf984939d8e12cb33a99673c8d026c5135e68"}],"title":"mm/huge_memory: transfer the pmd dirty bit to the folio on zap","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-89987","datePublished":"2026-09-16T10:33:02.270Z","dateReserved":"2026-09-11T19:38:34.779Z","dateUpdated":"2026-09-16T10:33:02.270Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-09-16 11:17:09","lastModifiedDate":"2026-09-16 11:17:09","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"89987","Ordinal":"1","Title":"mm/huge_memory: transfer the pmd dirty bit to the folio on zap","CVE":"CVE-2026-89987","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"89987","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/huge_memory: transfer the pmd dirty bit to the folio on zap\n\nzap_huge_pmd_folio() propagates the pmd young bit to the folio for the\nfile case, but not the dirty bit.  The pte path does propagate it, in\nzap_present_folio_ptes() and so does the pmd split path, in\n__split_huge_pmd_locked().\n\nFor most file mappings the omission is harmless, because writing to a\nshared file mapping goes through page_mkwrite(), which dirties the folio. \ntmpfs is different: it has no page_mkwrite(), and vma_wants_writenotify()\nis false for it, so a *read* fault on a MAP_SHARED tmpfs mapping installs\na writable pmd via do_read_fault().  do_read_fault() does not call\nfault_dirty_shared_page(), so subsequent stores through that mapping set\nonly the hardware dirty bit in the pmd and never call folio_mark_dirty(). \nA shmem folio allocated by a fault is marked uptodate but not dirty (see\nthe clear: block in shmem_get_folio_gfp()), so PG_dirty is never set at\nall.\n\nUnmapping such a folio - munmap(), or exit_mmap() when the process dies -\nthen loses the only record that it was written, because zap_huge_pmd()\ndrops the pmd without transferring the dirty bit.  Reclaim afterwards sees\na clean shmem folio: the whole swap-out block in shrink_folio_list() is\ninside \"if (folio_test_dirty(folio))\", so pageout() is skipped and the\nfolio falls into __remove_mapping().  There, folio_is_file_lru() is false\nfor a swapbacked folio, so no shadow entry is created and\n__filemap_remove_folio(folio, NULL) simply empties the i_pages slot.  The\ndata is freed without ever being written to swap, and the next fault on\nthat index returns a freshly zeroed folio.\n\nThis is silent data loss for any process that keeps state in a MAP_SHARED\ntmpfs segment across an unmap - for example a cache handed from one\nprocess generation to the next through /dev/shm.  It requires the folio to\nbe PMD-mapped, so it only shows up once shmem THP is enabled (which is\nwhat we did in Meta fleet and started noticing crashes); with THP off the\npte path transfers the dirty bit correctly.  It also only becomes visible\nwhen swap is enabled, because with no swap device shmem folios (which are\non the anon LRU) are not scanned by reclaim at all, so the clean folio is\nnever dropped.\n\nReproduced on x86_64 with a tmpfs mounted huge=within_size: read-fault a\n2MB-backed region, write a known pattern through the resulting mapping,\nmunmap, force reclaim of the cgroup, then re-map and read back.  Without\nthis patch the region reads back as zeros and vmstat shows zswpout 0 - the\ndata was discarded rather than swapped.  With this patch the region reads\nback correctly and the pages are swapped out as expected.  With\nhuge=never, or when the first touch is a write, the test passes either\nway.","Type":"Description","Title":"mm/huge_memory: transfer the pmd dirty bit to the folio on zap"}]}}}