{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-99917","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-09-25T10:25:14.445Z","datePublished":"2026-11-30T13:18:15.666Z","dateUpdated":"2026-11-30T13:18:15.666Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-11-30T13:18:15.666Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/swap: fix swap_cache_get_folio() returning a folio that left the swap cache\n\nswap_cache_get_folio() reads the folio from the swap table and takes a\nreference with folio_try_get(), without any lock.  If the folio is removed\nfrom the swap cache and freed in between, and its memory gets reused,\nfolio_try_get() still succeeds and we return a page that has nothing to do\nwith the swap entry:\n\n  CPU 0                                  CPU 1\n  do_swap_page()\n    swap_cache_get_folio()\n      swp_tb = swap_table_get()\n      folio = swp_tb_to_folio(swp_tb)\n                                         madvise(MADV_DONTNEED)\n                                           zap_nonpresent_ptes()\n                                             swap_put_entries_direct()\n                                               swap_put_entries_cluster()\n                                                 __try_to_reclaim_swap()\n                                                   swap_cache_del_folio()\n                                                   folio_put()   <- freed\n                                         page reused, e.g. as an anon\n                                         folio of another task\n      folio_try_get(folio)               <- succeeds\n      return folio\n    swap_update_readahead()              <- may clear PG_readahead on it\n    folio_lock_or_retry()                <- locks it\n    folio_matches_swap_entry() fails, unlock and put\n\nfilemap_get_entry() does the same lockless lookup for the page cache, and\nafter folio_try_get() it rechecks the xarray, because the folio may have\nbeen freed and reused in between.  swap_cache_get_folio() lost that\nrecheck when the swap cache moved to the swap table.\n\nSo CPU 0 writes to a folio it doesn't own: it may clear PG_readahead and\ntakes the folio lock of someone else's page, before\nfolio_matches_swap_entry() finds out the folio is not ours.\n\nWhen the race occurs, a swap fault can acquire a reference to a\nphysical page that has been freed and reused for an unrelated purpose,\npotentially by another process.  The fault handler may then clear that\npage's PG_readahead/PG_reclaim flag, wait on or acquire its folio lock,\nand potentially attempt to remove it from an unrelated swap cache.\n\nThese operations can interfere with unrelated workloads and may cause\nunexpected stalls and impaired reclaim.  The subsequent swap-entry\nvalidation normally prevents the wrong folio from being mapped into the\nfaulting process.\n\nIt's documented that caller always double checks the folio so this part\nis harmless from the aspect of data corruption or crash.\n\nRecheck the slot after folio_try_get() and retry if it no longer holds\nthis folio.\n\n[akpm@linux-foundation.org: add LLM-generated description of userspace impact]"}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/swap_state.c"],"versions":[{"version":"8578e0c00dcf0c58fbc32d4904ecaf8e802a6590","lessThan":"98e52d6946a95a28cc59605d97de364bdcd7691f","status":"affected","versionType":"git"},{"version":"8578e0c00dcf0c58fbc32d4904ecaf8e802a6590","lessThan":"5368a82b7c4d0c9ea9486ae7706917589909dd0c","status":"affected","versionType":"git"},{"version":"8578e0c00dcf0c58fbc32d4904ecaf8e802a6590","lessThan":"60f34fedf3a4c91ed631ed2f80713ab993cde5ee","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/swap_state.c"],"versions":[{"version":"6.18","status":"affected"},{"version":"0","lessThan":"6.18","status":"unaffected","versionType":"semver"},{"version":"6.18.63","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"7.3.4","lessThanOrEqual":"7.3.*","status":"unaffected","versionType":"semver"},{"version":"7.4-rc1","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18","versionEndExcluding":"6.18.63"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18","versionEndExcluding":"7.3.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18","versionEndExcluding":"7.4-rc1"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/98e52d6946a95a28cc59605d97de364bdcd7691f"},{"url":"https://git.kernel.org/stable/c/5368a82b7c4d0c9ea9486ae7706917589909dd0c"},{"url":"https://git.kernel.org/stable/c/60f34fedf3a4c91ed631ed2f80713ab993cde5ee"}],"title":"mm/swap: fix swap_cache_get_folio() returning a folio that left the swap cache","x_generator":{"engine":"bippy-1.2.0"}}}}