Skip to content
Heist/ feed
Back to feed
UnratedFix available

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

Type: advisorySources: OSV

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

Products
Kernel
Affected versions
Not specified
Fixed versions
6.12.10
CVEs
CVE-2024-57941
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 15:22 UTC · Revision 1

Source evidence

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

core-osv · Original source

Published 21 Jan 2025, 12:18 UTC

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

osv:CVE-2024-57941

Kernel

Fixed versions: 6.12.10

Complete source record
{
  "id": "49da5ee89984633525a25ec2cc6646713d289a384d99237e663a57b104f05737",
  "url": "https://osv.dev/vulnerability/CVE-2024-57941",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "netfs: Fix the (non-)cancellation of copy when cache is temporarily disabled",
    "summary": "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",
    "evidence": "osv:CVE-2024-57941",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.12.10",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2024-57941",
      "aliases": [
        "CVE-2024-57941"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "ee4cdf7ba857a894ad1650d6ab77669cbbfa329e"
                },
                {
                  "fixed": "ba37bdfe59fb43e80dd79290340a21864ba4b61e"
                },
                {
                  "fixed": "d0327c824338cdccad058723a31d038ecd553409"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-57941.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.12.0"
                },
                {
                  "fixed": "6.12.10"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-57941.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:37.157333669Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/ba37bdfe59fb43e80dd79290340a21864ba4b61e",
        "https://git.kernel.org/stable/c/d0327c824338cdccad058723a31d038ecd553409",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/57xxx/CVE-2024-57941.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-57941",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/57xxx/CVE-2024-57941.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-57941",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 504072,
  "published_at": "2025-01-21T12:18:09.834+00:00"
}