CVE-2024-57942 netfs: Fix ceph copy to cache on write-begin

Medium 5.5 Published Updated

A logic error in the Linux kernel's netfs subsystem causes a system hang when writing to a Ceph filesystem with caching enabled.

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-57942?

CVE-2024-57942 is a medium-severity denial of service vulnerability in Linux kernel, published on 21 Jan 2025. 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:

netfs: Fix ceph copy to cache on write-begin

At the end of netfs_unlock_read_folio() in which folios are marked appropriately for copying to the cache (either with by being marked dirty and having their private data set or by having PG_private_2 set) and then unlocked, the folio_queue struct has the entry pointing to the folio cleared. This presents a problem for netfs_pgpriv2_write_to_the_cache(), which is used to write folios marked with PG_private_2 to the cache as it expects to be able to trawl the folio_queue list thereafter to find the relevant folios, leading to a hang.

Fix this by not clearing the folio_queue entry if we're going to do the deprecated copy-to-cache. The clearance will be done instead as the folios are written to the cache.

This can be reproduced by starting cachefiles, mounting a ceph filesystem with "-o fsc" and writing to it.

Which versions are affected by CVE-2024-57942?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-57942?

Apply the vendor's patch.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2024-57942 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-57942, DEBIAN-CVE-2024-57942, GHSA-983w-hqxf-c48p, UBUNTU-CVE-2024-57942.

Is CVE-2024-57942 in your software?

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

Check your SBOMs for free