PT-2026-162884
CVE-2026-99917
·
Published
2026-11-30
·
Updated
2026-11-30
Description by
Score
N/A
Not availableNo severity ratings or metrics are available. When they are, we'll update the corresponding info on the page.
In the Linux kernel, the following vulnerability has been resolved:
mm/swap: fix swap cache get folio() returning a folio that left the swap cache
swap cache get folio() reads the folio from the swap table and takes a
reference with folio try get(), without any lock. If the folio is removed
from the swap cache and freed in between, and its memory gets reused,
folio try get() still succeeds and we return a page that has nothing to do
with the swap entry:
CPU 0 CPU 1
do swap page()
swap cache get folio()
swp tb = swap table get()
folio = swp tb to folio(swp tb)
madvise(MADV DONTNEED)
zap nonpresent ptes()
swap put entries direct()
swap put entries cluster()
try to reclaim swap()
swap cache del folio()
folio put() <- freed
page reused, e.g. as an anon
folio of another task
folio try get(folio) <- succeeds
return folio
swap update readahead() <- may clear PG readahead on it
folio lock or retry() <- locks it
folio matches swap entry() fails, unlock and put
filemap get entry() does the same lockless lookup for the page cache, and
after folio try get() it rechecks the xarray, because the folio may have
been freed and reused in between. swap cache get folio() lost that
recheck when the swap cache moved to the swap table.
So CPU 0 writes to a folio it doesn't own: it may clear PG readahead and
takes the folio lock of someone else's page, before
folio matches swap entry() finds out the folio is not ours.
When the race occurs, a swap fault can acquire a reference to a
physical page that has been freed and reused for an unrelated purpose,
potentially by another process. The fault handler may then clear that
page's PG readahead/PG reclaim flag, wait on or acquire its folio lock,
and potentially attempt to remove it from an unrelated swap cache.
These operations can interfere with unrelated workloads and may cause
unexpected stalls and impaired reclaim. The subsequent swap-entry
validation normally prevents the wrong folio from being mapped into the
faulting process.
It's documented that caller always double checks the folio so this part
is harmless from the aspect of data corruption or crash.
Recheck the slot after folio try get() and retry if it no longer holds
this folio.
[akpm@linux-foundation.org: add LLM-generated description of userspace impact]
Found an issue in the description? Have something to add? Feel free to write us 👾