{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2025-21988",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2025-21988"
  ],
  "published": "2025-04-02T12:52:04Z",
  "summary": "fs/netfs/read_collect: add to next->prev_donated",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nfs/netfs/read_collect: add to next->prev_donated\n\nIf multiple subrequests donate data to the same \"next\" request\n(depending on the subrequest completion order), each of them would\noverwrite the `prev_donated` field, causing data corruption and a\nBUG() crash (\"Can't donate prior to front\").",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:13",
        "name": "linux"
      },
      "versions": [
        "1:6.12.19-1+rpt1~bpo12+1",
        "1:6.12.19-1+rpt1"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-2712",
            "binary_version": "1:6.12.19-1+rpt1~bpo12+1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-v6",
            "binary_version": "1:6.12.19-1+rpt1~bpo12+1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-v7",
            "binary_version": "1:6.12.19-1+rpt1~bpo12+1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-v7l",
            "binary_version": "1:6.12.19-1+rpt1~bpo12+1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-v8",
            "binary_version": "1:6.12.19-1+rpt1~bpo12+1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-2712",
            "binary_version": "1:6.12.19-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-v6",
            "binary_version": "1:6.12.19-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-v7",
            "binary_version": "1:6.12.19-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-v7l",
            "binary_version": "1:6.12.19-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.19+rpt-rpi-v8",
            "binary_version": "1:6.12.19-1+rpt1"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.12.19-1+rpt1~bpo12+1": {
            "linux_commit": "121c2c384b9c2f4790ffb31b2cd25c7d75c8fda0",
            "upstream_version": "6.12.19",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.12.20"
          },
          "1:6.12.19-1+rpt1": {
            "linux_commit": "121c2c384b9c2f4790ffb31b2cd25c7d75c8fda0",
            "upstream_version": "6.12.19",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.12.20"
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2025-21988"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/62b9ad7e52d4777f7e775ee1f0ad2452f6041024"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/e25cec3b76aba47a49138d2162fc809c6cd49c9e"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/e2d46f2ec332533816417b60933954173f602121"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T12:19:11Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 9.8,
      "cvss_v3_severity": "Critical",
      "scenario": "AV:N - The vulnerable donation accounting in fs/netfs is driven entirely by data returned from a remote peer \u2014 subrequest completion order, short-read lengths and non-folio-aligned boundaries are chosen by the SMB/9p/Ceph/AFS server, and `netfs_read_subreq_terminated()` is invoked directly from those filesystems' network receive paths. A malicious or compromised file server, or an on-path attacker against an unsigned/unencrypted cifs, 9p or NFS mount, reaches the bug over the network.\nAC:L - The remote server controls both sides of the race: it decides when each READ response is sent and how much data it carries, so it can deterministically make two subrequests donate to the same successor and clobber `prev_donated`. The bug was reported from ordinary production use rather than a targeted fuzz, and the affected filesystems are enabled in all mainstream kernel configs.\nPR:N - The attacker is the remote server (or an on-path attacker) and needs no credentials or account on the victim host \u2014 only that the victim have a netfs-backed mount it reads from. No local privilege on the target is involved.\nUI:N - Ordinary background readahead on an already-mounted share (fstab/automount, container volume, WSL/Kata 9p, backup or indexer scans) is enough to drive the read-collection path; no specific victim action is required.\nS:U - The corruption and crash are confined to the kernel's own page cache and netfs request state; no VM, IOMMU or sandbox boundary is crossed.\nC:H - Lost donations make `netfs_unlock_read_folio()` mark folios uptodate for ranges no subrequest ever filled and inflate `rreq->transferred`, so read() returns uninitialized page-cache pages \u2014 arbitrary previously-freed kernel memory \u2014 to userspace, and the collector can also walk off the folio queue into invalid `folioq` pointers.\nI:H - The commit states the bug causes data corruption; because `NETFS_READ_FOR_WRITE` is one of the affected origins, a folio wrongly marked uptodate with unfilled content is subsequently written back, persisting corrupted data to the file on the server, and the broken start/len/transferred bookkeeping corrupts page-cache state generally.\nA:H - The mis-accounting hits an explicit `BUG()` (\"Can't donate prior to front\"/\"fpos > start\") in the filesystem completion context, killing the worker or softirq while rolling-buffer folios remain locked \u2014 a kernel panic, or at minimum an unrecoverable hang of every task waiting on those folios and of the mount."
    }
  }
}
