AZL-118400: CVE-2026-143241 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
btrfs: zoned: don't wait for ordered extents in dozonefinish()
dozonefinish() calls btrfswaitorderedroots(), which holds fsinfo->orderedoperationsmutex while waiting for writeback. It can be reached from writeback itself:
cowfilerange() -> btrfsreserveextent() -> findfreeextent() -> btrfszonefinishonebg() -> dozonefinish()
If another task holds the mutex and waits for that writeback, this deadlocks.
In general, we want to ensure all writes in the block group to complete before finishing the zone, as relocation does. However, the current callers do not need the wait (or cannot wait) in dozonefinish():
- Relocation already waits for reservations and ordered extents itself before calling btrfszonefinish(). - btrfsdeleteunusedbgs() checks that ->reserved is zero and sets the block group read-only while holding groupssem, so there can be no in-flight data write. - btrfszonefinishonebg() is called from the allocation path and cannot wait.
Dropping the wait is still safe. Once the block group is read-only, ->reserved can only drop, and for data it only drops after the ordered extent's I/O has completed. So if ->reserved is zero, no data write is left in flight. If it is non-zero, dozonefinish() returns -EAGAIN, which all callers handle.
This makes btrfszonefinishonebg() fail with -EAGAIN when it races with an allocation in the selected block group.
Affected Software
Event History
Frequently Asked Questions
Which deployments are relevant to this issue?
The issue is in the Btrfs zoned code path. Systems running the listed kernel package are relevant when they use Btrfs zoned functionality and exercise the affected allocation or writeback paths.
What runtime condition leads to the deadlock?
The deadlock can occur when zone finishing is reached from writeback and do_zone_finish() waits for ordered extents while holding fs_info->ordered_operations_mutex. Another task can hold that mutex while waiting for the same writeback to complete.
Is it safe for the affected callers to avoid waiting for ordered extents when finishing a zone?
According to the fix description, the current callers either already perform the required waits, ensure there are no in-flight data writes, or cannot wait because they run from the allocation path. Dropping the wait in do_zone_finish() is described as safe for those callers.