# CVE-2024-26832: mm: zswap: fix missing folio cleanup in writeback race path

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.22%, higher than 13% of CVEs (2026-12-01)
- Published: 2024-04-17T10:10:01.016Z
- Modified: 2026-06-17T07:18:27.317Z
- Weaknesses: CWE-459
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

mm: zswap: fix missing folio cleanup in writeback race path

In zswap_writeback_entry(), after we get a folio from
__read_swap_cache_async(), we grab the tree lock again to check that the
swap entry was not invalidated and recycled.  If it was, we delete the
folio we just added to the swap cache and exit.

However, __read_swap_cache_async() returns the folio locked when it is
newly allocated, which is always true for this path, and the folio is
ref'd.  Make sure to unlock and put the folio before returning.

This was discovered by code inspection, probably because this path handles
a race condition that should not happen often, and the bug would not crash
the system, it will only strand the folio indefinitely.

(As written by CVE List.)

## Affected

- Linux Linux: from 2cab13f500a6333bd2b853783ac76be9e4956f8a before 14f1992430ef9e647b02aa8ca12c5bcb9a1dffea; from 04fc7816089c5a32c29a04ec94b998e219dfb946 before 6156277d1b26cb3fdb6fcbf0686ab78268571644; from 04fc7816089c5a32c29a04ec94b998e219dfb946 before e2891c763aa2cff74dd6b5e978411ccf0cf94abe; from 04fc7816089c5a32c29a04ec94b998e219dfb946 before e3b63e966cac0bf78aaa1efede1827a252815a1d; ba700ea13bf0105a4773c654f7d3bef8adb64ab2; from 6.1.30 before 6.1.80; from 6.3.4 before 6.4; 6.4 (not affected: before 6.4; from 6.1.80 up to 6.1.*; from 6.6.19 up to 6.6.*; from 6.7.7 up to 6.7.*; from 6.8 up to *)
- linux linux_kernel: from 6.1.30 before 6.1.80; from 6.4 before 6.6.19; from 6.7 before 6.7.7; 6.3.4; 6.8

## References

- <https://git.kernel.org/stable/c/14f1992430ef9e647b02aa8ca12c5bcb9a1dffea> (patch)
- <https://git.kernel.org/stable/c/6156277d1b26cb3fdb6fcbf0686ab78268571644> (patch)
- <https://git.kernel.org/stable/c/e2891c763aa2cff74dd6b5e978411ccf0cf94abe> (patch)
- <https://git.kernel.org/stable/c/e3b63e966cac0bf78aaa1efede1827a252815a1d> (patch)

## Sources

- CVE List: [CVE-2024-26832](https://www.cve.org/CVERecord?id=CVE-2024-26832), CVE Terms of Use, modified 2026-05-23
- NVD: [CVE-2024-26832](https://nvd.nist.gov/vuln/detail/CVE-2024-26832), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-26832 · Whole record: https://cve.day/CVE-2024-26832.json · Rebuilt by cve.day 2026-11-25T22:58:39.342Z
