{"id":25673,"date":"2026-09-18T04:31:43","date_gmt":"2026-09-17T20:31:43","guid":{"rendered":"https:\/\/www.54iter.cn\/?vuln=cve-2026-90264"},"modified":"2026-09-18T04:31:43","modified_gmt":"2026-09-17T20:31:43","slug":"cve-2026-90264","status":"publish","type":"vuln","link":"https:\/\/www.54iter.cn\/?vuln=cve-2026-90264","title":{"rendered":"CVE-2026-90264 &#8211; In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: always wait fo"},"content":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>btrfs: always wait for ordered extents to avoid OE races<\/p>\n<p>[BUG]<br \/>\nSyzbot reported a bug that there can be conflicting OEs for the same<br \/>\nrange:<\/p>\n<p>  BTRFS critical (device loop4): panic in insert_ordered_extent:264: overlapping ordered extents, existing oe file_offset 16384 num_bytes 430080 flags 0x1089, new oe file_offset 16384 num_bytes 430080 flags 0x80 (errno=-17 Object alrea[  179.162726][ T6897] BTRFS critical (device loop4): panic in insert_ordered_extent:264: overlapping ordered extents, existing oe file_offset 16384 num_bytes 430080 flags 0x1089, new oe file_offset 16384 num_bytes 430080 flags 0x80 (errno=-17 Object already exists)<br \/>\n  &#8212;&#8212;&#8212;&#8212;[ cut here ]&#8212;&#8212;&#8212;&#8212;<br \/>\n  kernel BUG at fs\/btrfs\/ordered-data.c:264!<br \/>\n  Hardware name: Google Google Compute Engine\/Google Compute Engine, BIOS Google 05\/09\/2026<br \/>\n  RIP: 0010:btrfs_alloc_ordered_extent+0x943\/0xad0<br \/>\n  Call Trace:<\/p>\n<p>   cow_file_range+0x744\/0x12a0<br \/>\n   fallback_to_cow+0x5ea\/0xa00<br \/>\n   run_delalloc_nocow+0x110c\/0x17a0<br \/>\n   btrfs_run_delalloc_range+0xbe4\/0x1c20<br \/>\n   writepage_delalloc+0x104d\/0x1ba0<br \/>\n   btrfs_writepages+0x1667\/0x28b0<br \/>\n   do_writepages+0x338\/0x560<br \/>\n   filemap_fdatawrite_range+0x1f2\/0x300<br \/>\n   btrfs_fdatawrite_range+0x54\/0xf0<br \/>\n   btrfs_direct_write+0x6a0\/0xc30<br \/>\n   btrfs_do_write_iter+0x329\/0x790<br \/>\n   do_iter_readv_writev+0x624\/0x8d0<br \/>\n   vfs_writev+0x34c\/0x990<br \/>\n   __se_sys_pwritev2+0x17a\/0x2a0<br \/>\n   do_syscall_64+0x174\/0x580<br \/>\n   entry_SYSCALL_64_after_hwframe+0x77\/0x7f<\/p>\n<p>  &#8212;[ end trace 0000000000000000 ]&#8212;<\/p>\n<p>[CAUSE]<br \/>\nSince commit ff66fe666233 (&#8220;btrfs: fix incorrect buffered IO fallback<br \/>\nfor append direct writes&#8221;), if the direct IO finished short, we will<br \/>\nrevert the isize back to the original one, so that append writes can be<br \/>\nrespected during the buffered fallback.<\/p>\n<p>Normally we rely on lock_and_cleanup_extent_if_need() function during<br \/>\nbuffered writeback to wait for any existing ordered extents.<\/p>\n<p>But that ordered extent waiting only happens if the start_pos is inside<br \/>\nthe isize.<br \/>\nSince we have reverted the isize during failed direct IO, we will not<br \/>\nwait for any ordered extents.<\/p>\n<p>This means we can have a race where the direct IO OE is still in the<br \/>\ntree, finished but not yet removed, then we&#8217;re inserting the OE for the<br \/>\nbuffered write, causing the above crash.<\/p>\n<p>[FIX]<br \/>\nMake the OE wait to be unconditional, to handle the reverted isize<br \/>\nsituation.<\/p>\n<p>And since lock_and_cleanup_extent_if_need() now either lock the<br \/>\nextents or return -EAGAIN, also remove the branches that handles<br \/>\nno-extent-locked cases, and rename it to remove the &#8220;_if_need&#8221; suffix.<\/p>\n<p>The following micro benchmark shows the runtime difference for<br \/>\nbtrfs_buffered_write(), doing `xfs_io -f -c &#8220;pwrite 0 1m&#8221;` workload,<br \/>\nall values are the average runtime in nano seconds.<\/p>\n<p>      function runtime              |   before    |     after<br \/>\n &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n lock_and_cleanup_extent_if_need()  |     58.2    |    183.0<br \/>\n btrfs_buffered_write()             |   2115.6    |   2973.3<\/p>\n<p>The overall runtime of btrfs_buffered_write() is still pretty<br \/>\ntiny (still less than 3 micro seconds), I&#8217;d say the extra cost is still<br \/>\nacceptable.<\/p>\n<p>An alternative to fix this problem is to wait ordered extents during<br \/>\niomap_end() where the isize revert is done.<\/p>\n<p>But that solution will break nowait requirement, as if a nowait direct<br \/>\nIO finished short, we have to wait for the OEs unconditionally or the<br \/>\nnext append buffered IO can still hit the same problem.<\/p>\n<p>So here we have to move the wait cost to buffered write, but at least<br \/>\nthe code is slightly more streamline.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>btrfs: always wait for ordered extents to avoid OE races<\/p>\n<p>[BUG]<br \/>\nSyzbot reported a bug that there can be conflicting OEs for the sam<\/p>\n","protected":false},"template":"","meta":[],"categories":[],"tags":[],"class_list":["post-25673","vuln","type-vuln","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln\/25673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln"}],"about":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/types\/vuln"}],"wp:attachment":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=25673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=25673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=25673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}