{"id":"CVE-2025-21988","state":"PUBLISHED","title":"fs/netfs/read_collect: add to next->prev_donated","description":"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\").","publishedAt":"2025-04-02T12:53:12.170Z","updatedAt":"2026-08-05T11:55:52.895Z","severity":{"score":9.8,"label":"Critical","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"ee4cdf7ba857a894ad1650d6ab77669cbbfa329e","status":"affected","lessThan":"62b9ad7e52d4777f7e775ee1f0ad2452f6041024","versionType":"git"},{"version":"ee4cdf7ba857a894ad1650d6ab77669cbbfa329e","status":"affected","lessThan":"e25cec3b76aba47a49138d2162fc809c6cd49c9e","versionType":"git"},{"version":"ee4cdf7ba857a894ad1650d6ab77669cbbfa329e","status":"affected","lessThan":"e2d46f2ec332533816417b60933954173f602121","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/netfs/read_collect.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.12","versionType":"semver"},{"version":"6.12.20","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.8","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/netfs/read_collect.c"]}],"references":["https://git.kernel.org/stable/c/62b9ad7e52d4777f7e775ee1f0ad2452f6041024","https://git.kernel.org/stable/c/e25cec3b76aba47a49138d2162fc809c6cd49c9e","https://git.kernel.org/stable/c/e2d46f2ec332533816417b60933954173f602121"],"weaknesses":[],"ingestedAt":"2026-10-29T20:08:39.238Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/21xxx/CVE-2025-21988.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-21988","state":"PUBLISHED","datePublished":"2025-04-02T12:53:12.170Z","dateUpdated":"2026-08-05T11:55:52.895Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-12-29T08:45:45.800Z"},"containers":{"cna":{"title":"fs/netfs/read_collect: add to next->prev_donated","descriptions":[{"lang":"en","value":"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\")."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"ee4cdf7ba857a894ad1650d6ab77669cbbfa329e","status":"affected","lessThan":"62b9ad7e52d4777f7e775ee1f0ad2452f6041024","versionType":"git"},{"version":"ee4cdf7ba857a894ad1650d6ab77669cbbfa329e","status":"affected","lessThan":"e25cec3b76aba47a49138d2162fc809c6cd49c9e","versionType":"git"},{"version":"ee4cdf7ba857a894ad1650d6ab77669cbbfa329e","status":"affected","lessThan":"e2d46f2ec332533816417b60933954173f602121","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/netfs/read_collect.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.12","versionType":"semver"},{"version":"6.12.20","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.8","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/netfs/read_collect.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/62b9ad7e52d4777f7e775ee1f0ad2452f6041024"},{"url":"https://git.kernel.org/stable/c/e25cec3b76aba47a49138d2162fc809c6cd49c9e"},{"url":"https://git.kernel.org/stable/c/e2d46f2ec332533816417b60933954173f602121"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","baseScore":9.8,"baseSeverity":"CRITICAL"},"scenarios":[{"lang":"en","value":"AV:N - The vulnerable donation accounting in fs/netfs is driven entirely by data returned from a remote peer — 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 — 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 — arbitrary previously-freed kernel memory — 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 — a kernel panic, or at minimum an unrecoverable hang of every task waiting on those folios and of the mount."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:55:52.895Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12","versionEndExcluding":"6.12.20"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12","versionEndExcluding":"6.13.8"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12","versionEndExcluding":"6.14"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}