CVE-2026-143166: btrfs: fix bio counter and bioc leak when async checksumming fails

Published Dec 3, 2026
·
Updated

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

btrfs: fix bio counter and bioc leak when async checksumming fails

A single failed checksum allocation can make a later device replace hang forever. btrfssubmitchunk() takes a dev-replace bio counter reference and a bioc before it hands a write to the checksum worker. If the checksum fails there (e.g., its allocation fails), runoneasyncdone() ends the bio but drops neither. The counter then never gets back to zero and the next replace waits for it:

[ 8.369] BTRFS info (device ram0): devreplace from /dev/ram0 (devid 1) to /dev/ram1 finished [41.534] INFO: task btrfscsum:80 blocked for more than 20 seconds. [41.534] btrfsrmdevreplaceblocked+0x135/0x180 [41.534] btrfsdevreplacefinishing+0xefe/0x13b0

The worker is only used when CONFIGBTRFSEXPERIMENTAL is off and the checksum isn't a fast one, e.g., sha256. We hit it on a sha256 filesystem.

We put the bioc and drop the counter in that error branch. We also put the bioc on the synchronous error path and on the btrfssplitbio() error path, which both only drop the counter. With the fix, the replace doesn't hang anymore.

This bug was identified and confirmed with the help of fault-injection testing on a deterministic hypervisor currently under development. Our C reproducer however hits it within about 35s.

Affected Software

3 affected componentsFixes available
Linux Linux kernel
linux/kernel>=6.3.0<6.18.66
6.18.66
linux/kernel>=6.19.0<7.3.7
7.3.7

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18.66
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.7

Event History

Dec 3, 2026
CVE Published
via MITRE·09:20 AM
Data Sourced
via MITRE·09:20 AM
Description
Data Sourced
via OSV·09:20 AM
DescriptionAffected Software
Data Sourced
via NVD·10:17 AM
Description

Frequently Asked Questions

1

Which systems are exposed to the device-replace hang?

The affected path is used when CONFIG_BTRFS_EXPERIMENTAL is disabled and the filesystem uses a non-fast checksum algorithm, such as sha256. A device replacement must then encounter a checksum failure, for example from an allocation failure.

2

What operational symptom indicates this issue may already be occurring?

A subsequent Btrfs device replacement can wait indefinitely because the device-replace bio counter does not return to zero. The kernel may report a btrfscsum task blocked for more than 20 seconds, with stack frames including btrfs_rm_dev_replace_blocked and btrfs_dev_replace_finishing.

3

Is a checksum failure the only relevant error path?

No. The fix also releases the bioc on synchronous error handling and on btrfs_split_bio() errors, where the bio counter was previously dropped without releasing the bioc.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203