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

- 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.18%, higher than 7% of CVEs (2026-12-01)
- Published: 2025-01-21T12:18:10.532Z
- Modified: 2026-06-17T08:14:16.993Z
- Assigned by: Linux

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

(As written by CVE List.)

## Affected

- Linux Linux: from ee4cdf7ba857a894ad1650d6ab77669cbbfa329e before 43b8d3249b0b71bad239d42dbe08ce6c938ba000; from ee4cdf7ba857a894ad1650d6ab77669cbbfa329e before 38cf8e945721ffe708fa675507465da7f4f2a9f7; 6.12 (not affected: before 6.12; from 6.12.10 up to 6.12.*; from 6.13 up to *)
- linux linux_kernel: from 6.12 before 6.12.10; 6.13

## References

- <https://git.kernel.org/stable/c/43b8d3249b0b71bad239d42dbe08ce6c938ba000> (patch)
- <https://git.kernel.org/stable/c/38cf8e945721ffe708fa675507465da7f4f2a9f7> (patch)

## Sources

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

---

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