{"id":"CVE-2026-89760","summary":"mm, swap: don't free a hibernation slot that is in the swap cache","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm, swap: don't free a hibernation slot that is in the swap cache\n\nA slot with a folio in the swap cache is freed when the folio leaves the\ncache, not when its count drops.  swap_put_entries_cluster() follows that\nrule.  swap_free_hibernation_slot() does not, it calls\n__swap_cluster_free_entries() whether or not a folio sits on the slot.\n\nCluster readahead can put one there.  It walks a raw page_cluster sized\nwindow of offsets around the faulting entry, and a hibernation slot passes\n__swap_cache_add_check() because it is not a folio and its count is not\nzero.  Freeing the slot then clears the entry under that folio.\n\nThe folio is now unreachable from the swap table, and the offset goes back\nto the allocator.  The folio is still on the LRU though, so reclaim can\npick it up later.  It then takes the old offset out of folio-\u003eswap and\noverwrites the table entry there, which by then may belong to someone\nelse.\n\nThis bug can trigger silent memory corruption, process crashes, or data\ninstability across completely unrelated userspace applications - typically\noccurring when uswsusp is preparing the hibernation image.\n\nI found this while working on giving hibernation slots their own marker in\nthe swap table, which I had discussed with Kairui. \n(https://lore.kernel.org/linux-mm/abp7aDgYLrxF3Me8@KASONG-MC4/) As far as\nI know there are no reports, so there is no Reported-by/Closes to add.\n\nCheck for a cached folio before freeing.  The slot is then left in the\nordinary state where only the swap cache holds it, and it is freed when\nthe folio leaves the cache, either through the reclaim below or through\nnormal reclaim later.","modified":"2026-09-13T03:47:20.784440031Z","published":"2026-09-11T19:47:02.090Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/89xxx/CVE-2026-89760.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/10d9012e83efedde8718ceaa5053f836e0c8596c"},{"type":"WEB","url":"https://git.kernel.org/stable/c/a6df73156f2d85746c69adbf13d0f5ea200e0626"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/89xxx/CVE-2026-89760.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-89760"},{"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":"0d6af9bcf383bcdf601e670bb605861b01e318e7"},{"fixed":"a6df73156f2d85746c69adbf13d0f5ea200e0626"},{"fixed":"10d9012e83efedde8718ceaa5053f836e0c8596c"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-89760.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"7.1.0"},{"fixed":"7.2.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-89760.json"}}],"schema_version":"1.9.0"}