ZeroHour

CVE-2026-89760

mass

Premature swap-slot free during hibernation causes memory corruption in Linux kernel

CVSS 3.1
7.8 high
EPSS
Published
()
Modified
AI analysis

A flaw in the Linux kernel's memory management/swap subsystem causes swap_free_hibernation_slot() to free a swap slot that still has a folio (page) in the swap cache, violating the rule that such slots are only freed when the folio leaves the cache. Cluster readahead around a faulting swap entry can place a folio on a hibernation slot, which passes the existing checks because it is not a normal folio entry and its count is nonzero; freeing the slot then returns the offset to the allocator while the folio still references it, so later reclaim writes through the stale folio->swap offset and can overwrite a swap table entry now owned by someone else. The bug is typically triggered when uswsusp (userspace software suspend) is preparing the hibernation image on a system with swap, and results in silent memory corruption, process crashes, or data instability across completely unrelated userspace applications. Any Linux system configured with swap and hibernation is potentially affected, though no specific kernel version ranges were stated in the advisory. The fix (check for a cached folio before freeing) is merged; there are no known reports, no public PoC, and no evidence of exploitation in the wild.

What to do: Update to a kernel release containing the fix (check that your kernel includes the mm/swap patch 'don't free a hibernation slot that is in the swap cache'); until patched, disable or avoid hibernation via uswsusp on swap-enabled systems as a mitigation. Watch for unexplained process crashes or memory corruption during or after hibernation image preparation as an indicator the bug has been hit.

Affected
Linux kernel
Estimated exposure
masspotentially tens to hundreds of millions of Linux systems (any swap-enabled machine that hibernates) — The Linux kernel ships on the vast majority of servers, desktops, and laptops, and hibernation with swap is a common configuration on desktop/laptop distributions, though only systems that actually enter hibernation via uswsusp can trigger…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

In the Linux kernel, the following vulnerability has been resolved: mm, swap: don't free a hibernation slot that is in the swap cache A slot with a folio in the swap cache is freed when the folio leaves the cache, not when its count drops. swap_put_entries_cluster() follows that rule. swap_free_hibernation_slot() does not, it calls __swap_cluster_free_entries() whether or not a folio sits on the slot. Cluster readahead can put one there. It walks a raw page_cluster sized window of offsets around the faulting entry, and a hibernation slot passes __swap_cache_add_check() because it is not a folio and its count is not zero. Freeing the slot then clears the entry under that folio. The folio is now unreachable from the swap table, and the offset goes back to the allocator. The folio is still on the LRU though, so reclaim can pick it up later. It then takes the old offset out of folio->swap and overwrites the table entry there, which by then may belong to someone else. This bug can trigger silent memory corruption, process crashes, or data instability across completely unrelated userspace applications - typically occurring when uswsusp is preparing the hibernation image. I found this while working on giving hibernation slots their own marker in the swap table, which I had discussed with Kairui. (https://lore.kernel.org/linux-mm/abp7aDgYLrxF3Me8@KASONG-MC4/) As far as I know there are no reports, so there is no Reported-by/Closes to add. Check for a cached folio before freeing. The slot is then left in the ordinary state where only the swap cache holds it, and it is freed when the folio leaves the cache, either through the reclaim below or through normal reclaim later.

Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

In the news

No ingested article mentions this CVE yet.