# CVE-2024-57941: netfs: Fix the (non-)cancellation of copy when cache is temporarily disabled

- 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:09.834Z
- Modified: 2026-06-17T08:14:16.890Z
- Assigned by: Linux

## Description

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

netfs: Fix the (non-)cancellation of copy when cache is temporarily disabled

When the caching for a cookie is temporarily disabled (e.g. due to a DIO
write on that file), future copying to the cache for that file is disabled
until all fds open on that file are closed.  However, if netfslib is using
the deprecated PG_private_2 method (such as is currently used by ceph), and
decides it wants to copy to the cache, netfs_advance_write() will just bail
at the first check seeing that the cache stream is unavailable, and
indicate that it dealt with all the content.

This means that we have no subrequests to provide notifications to drive
the state machine or even to pin the request and the request just gets
discarded, leaving the folios with PG_private_2 set.

Fix this by jumping directly to cancel the request if the cache is not
available.  That way, we don't remove mark3 from the folio_queue list and
netfs_pgpriv2_cancel() will clean up the folios.

This was found by running the generic/013 xfstest against ceph with an
active cache and the "-o fsc" option passed to ceph.  That would usually
hang

(As written by CVE List.)

## Affected

- Linux Linux: from ee4cdf7ba857a894ad1650d6ab77669cbbfa329e before ba37bdfe59fb43e80dd79290340a21864ba4b61e; from ee4cdf7ba857a894ad1650d6ab77669cbbfa329e before d0327c824338cdccad058723a31d038ecd553409; 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/ba37bdfe59fb43e80dd79290340a21864ba4b61e> (patch)
- <https://git.kernel.org/stable/c/d0327c824338cdccad058723a31d038ecd553409> (patch)

## Sources

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

---

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