{"id":"CVE-2026-143166","state":"PUBLISHED","title":"btrfs: fix bio counter and bioc leak when async checksumming fails","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: fix bio counter and bioc leak when async checksumming fails\n\nA single failed checksum allocation can make a later device replace\nhang forever.  btrfs_submit_chunk() takes a dev-replace bio counter\nreference and a bioc before it hands a write to the checksum worker.\nIf the checksum fails there (e.g., its allocation fails),\nrun_one_async_done() ends the bio but drops neither.  The counter then\nnever gets back to zero and the next replace waits for it:\n\n  [ 8.369] BTRFS info (device ram0): dev_replace from /dev/ram0 (devid 1) to /dev/ram1 finished\n  [41.534] INFO: task btrfscsum:80 blocked for more than 20 seconds.\n  [41.534]  btrfs_rm_dev_replace_blocked+0x135/0x180\n  [41.534]  btrfs_dev_replace_finishing+0xefe/0x13b0\n\nThe worker is only used when CONFIG_BTRFS_EXPERIMENTAL is off and the\nchecksum isn't a fast one, e.g., sha256.  We hit it on a sha256\nfilesystem.\n\nWe put the bioc and drop the counter in that error branch.  We also\nput the bioc on the synchronous error path and on the btrfs_split_bio()\nerror path, which both only drop the counter.  With the fix, the\nreplace doesn't hang anymore.\n\nThis bug was identified and confirmed with the help of fault-injection\ntesting on a deterministic hypervisor currently under development.  Our\nC reproducer however hits it within about 35s.","publishedAt":"2026-12-03T09:20:03.682Z","updatedAt":"2026-12-03T09:20:03.682Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f8a53bb58ec7e2150f9b03f210675ba3e6d8b919","status":"affected","lessThan":"b252abcdaf20a365a03a360356c9fe336116c228","versionType":"git"},{"version":"f8a53bb58ec7e2150f9b03f210675ba3e6d8b919","status":"affected","lessThan":"d72253b60d43901c873f0ada101ff4474774eecc","versionType":"git"},{"version":"f8a53bb58ec7e2150f9b03f210675ba3e6d8b919","status":"affected","lessThan":"d27d0039bc1334be8a72c769e14c0b0c3efc317d","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/btrfs/bio.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.3","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.3","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/btrfs/bio.c"]}],"references":["https://git.kernel.org/stable/c/b252abcdaf20a365a03a360356c9fe336116c228","https://git.kernel.org/stable/c/d72253b60d43901c873f0ada101ff4474774eecc","https://git.kernel.org/stable/c/d27d0039bc1334be8a72c769e14c0b0c3efc317d"],"weaknesses":[],"ingestedAt":"2026-12-03T09:40:06.136Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/143xxx/CVE-2026-143166.json","commit":"9e309c7c0f08856e2558a1df33f75dca027fab70","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143166","state":"PUBLISHED","datePublished":"2026-12-03T09:20:03.682Z","dateUpdated":"2026-12-03T09:20:03.682Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-12-03T03:10:28.356Z"},"containers":{"cna":{"title":"btrfs: fix bio counter and bioc leak when async checksumming fails","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: fix bio counter and bioc leak when async checksumming fails\n\nA single failed checksum allocation can make a later device replace\nhang forever.  btrfs_submit_chunk() takes a dev-replace bio counter\nreference and a bioc before it hands a write to the checksum worker.\nIf the checksum fails there (e.g., its allocation fails),\nrun_one_async_done() ends the bio but drops neither.  The counter then\nnever gets back to zero and the next replace waits for it:\n\n  [ 8.369] BTRFS info (device ram0): dev_replace from /dev/ram0 (devid 1) to /dev/ram1 finished\n  [41.534] INFO: task btrfscsum:80 blocked for more than 20 seconds.\n  [41.534]  btrfs_rm_dev_replace_blocked+0x135/0x180\n  [41.534]  btrfs_dev_replace_finishing+0xefe/0x13b0\n\nThe worker is only used when CONFIG_BTRFS_EXPERIMENTAL is off and the\nchecksum isn't a fast one, e.g., sha256.  We hit it on a sha256\nfilesystem.\n\nWe put the bioc and drop the counter in that error branch.  We also\nput the bioc on the synchronous error path and on the btrfs_split_bio()\nerror path, which both only drop the counter.  With the fix, the\nreplace doesn't hang anymore.\n\nThis bug was identified and confirmed with the help of fault-injection\ntesting on a deterministic hypervisor currently under development.  Our\nC reproducer however hits it within about 35s."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f8a53bb58ec7e2150f9b03f210675ba3e6d8b919","status":"affected","lessThan":"b252abcdaf20a365a03a360356c9fe336116c228","versionType":"git"},{"version":"f8a53bb58ec7e2150f9b03f210675ba3e6d8b919","status":"affected","lessThan":"d72253b60d43901c873f0ada101ff4474774eecc","versionType":"git"},{"version":"f8a53bb58ec7e2150f9b03f210675ba3e6d8b919","status":"affected","lessThan":"d27d0039bc1334be8a72c769e14c0b0c3efc317d","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/btrfs/bio.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.3","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.3","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/btrfs/bio.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/b252abcdaf20a365a03a360356c9fe336116c228"},{"url":"https://git.kernel.org/stable/c/d72253b60d43901c873f0ada101ff4474774eecc"},{"url":"https://git.kernel.org/stable/c/d27d0039bc1334be8a72c769e14c0b0c3efc317d"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-12-03T09:20:03.682Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.3","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.3","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.3","versionEndExcluding":"7.4-rc3"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}