CVE-2026-143379: btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing
In the Linux kernel, the following vulnerability has been resolved:
btrfs: scrub: fix lost wakeup and hang when cancelling a scrub that is finishing
When scrub finishes, it does a wakeup on the fsinfo->scrubpausewait wait queue and then sets dev->scrubsctx to NULL. On the other hand the scrub cancel code (btrfsscrubcanceldev()) waits on that wait queue for dev->scrubsctx to be NULL. So this means if btrfsscrubcanceldev() is called right when scrub is finishing and sees the wakeup before the NULL is assigned to dev->scrubsctx by btrfsscrubdev(), it hangs.
Fix this by doing the wakeup in btrfsscrubdev() after setting dev->scrubsctx to NULL.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.10.276 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.227 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.120 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.66 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.7 - Compensating control
In btrfs_scrub_dev(), perform the wakeup after setting dev->scrub_sctx to NULL.
Event History
Frequently Asked Questions
Which upstream stable changes contain the fix?
The referenced stable changes are 298319ceee5ce66191b311b6b6d02c2fa0f6502a, 8690b22c1cdb1d8656f1aee14025b642c93bd522, and d2b84032dddadbfcaf6818bfc890e7064c2ba692.