CVE-2026-143242: btrfs: zoned: fix possible UAF in wait_eb_writebacks()
In the Linux kernel, the following vulnerability has been resolved:
btrfs: zoned: fix possible UAF in waitebwritebacks()
waitebwritebacks() iterates the fsinfo->buffertree xarray and waits for the writeback of these extent-buffers. Waiting for writeback needs to be done without the rcureadlock() held (because it can sleep) and thus the loop drops the rcureadlock() before calling into waitonextentbufferwriteback(). But extentbuffers are freed through RCU, so if btrfsreleaseextentbufferrcu() is scheduled while we're still waiting on the writeback, the extentbuffer will be freed causing a use-after-free.
Similar to what is done in findextentbuffernolock(), get a reference to the extentbuffer before calling into waitonextentbufferwriteback() so a successful writeback does not free the extentbuffer while we still have a reference to it.
Affected Software
Event History
Frequently Asked Questions
Which systems are relevant for triage?
The issue is in the Linux kernel's Btrfs zoned code, in the wait_eb_writebacks() path. Systems not using that code path are not identified as affected by the supplied information.
How can maintainers verify that the fix is present?
Verify that wait_eb_writebacks() obtains a reference to each extent buffer before dropping the RCU read lock and waiting for writeback. The supplied stable-tree patch references are c5c4e275a5f95f016cd9a0e3cfda63f44b7a9234, 03b6dadd0fcb77b7ebcaf3a007f0880acb4844f5, and 8ca411c7ad2c02ae65ae208a3f7483d6e0159c4f.