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

Medium 5.5 Published Updated

A race condition in the Linux kernel zswap writeback path fails to release a folio, potentially leading to memory exhaustion and denial of service.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-26832?

CVE-2024-26832 is a medium-severity vulnerability in Linux kernel, published on 17 Apr 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official 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.

Weakness: CWE-459

Which versions are affected by CVE-2024-26832?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-26832?

Apply the vendor's patch.

Is CVE-2024-26832 being exploited?

There is no known exploitation of CVE-2024-26832 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-26832, DEBIAN-CVE-2024-26832, GHSA-fpqf-cxvg-rf89, UBUNTU-CVE-2024-26832.

Is CVE-2024-26832 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free