{"id":4647,"date":"2026-09-04T18:46:40","date_gmt":"2026-09-04T10:46:40","guid":{"rendered":"https:\/\/www.54iter.cn\/?vuln=cve-2026-64567"},"modified":"2026-09-04T18:46:40","modified_gmt":"2026-09-04T10:46:40","slug":"cve-2026-64567","status":"publish","type":"vuln","link":"https:\/\/www.54iter.cn\/?vuln=cve-2026-64567","title":{"rendered":"CVE-2026-64567 [HIGH] &#8211; In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: reject free sp"},"content":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>btrfs: reject free space cache with more entries than pages<\/p>\n<p>When loading a v1 free space cache, __load_free_space_cache() takes<br \/>\nnum_entries and num_bitmaps straight from the on-disk<br \/>\nbtrfs_free_space_header. That header is stored in the tree_root under a key<br \/>\nwith type 0, which the tree-checker has no case for, so neither count is<br \/>\nvalidated before the load trusts it.<\/p>\n<p>The load loops num_entries times and maps the next page whenever the current<br \/>\none runs out, going through io_ctl_check_crc() -&gt; io_ctl_map_page(), which<br \/>\ndoes io_ctl-&gt;pages[io_ctl-&gt;index++]. But pages[] is allocated in<br \/>\nio_ctl_init() from the cache inode&#8217;s i_size, not from num_entries:<\/p>\n<p>\tnum_pages = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE);<br \/>\n\tio_ctl-&gt;pages = kcalloc(num_pages, sizeof(struct page *), GFP_NOFS);<\/p>\n<p>So if num_entries claims more records than the pages can hold, io_ctl-&gt;index<br \/>\nruns off the end of pages[]. The write side never hits this because<br \/>\nio_ctl_add_entry() and io_ctl_add_bitmap() both stop once<br \/>\nio_ctl-&gt;index &gt;= io_ctl-&gt;num_pages; the read side just never had the same<br \/>\ncheck.<\/p>\n<p>To trigger it, take a clean cache (num_entries =  here), set num_entries<br \/>\nin the header to 0x10000, and fix up the leaf checksum so it still passes<br \/>\nthe tree-checker. The cache inode has i_size = 65536, so num_pages is 16 and<br \/>\npages[] is a 16-pointer (kmalloc-128) array. The load now tries to read<br \/>\n65536 entries, io_ctl-&gt;index walks up to 16, and pages[16] is read past the<br \/>\narray:<\/p>\n<p>  BUG: KASAN: slab-out-of-bounds in io_ctl_check_crc (fs\/btrfs\/free-space-cache.c:420 fs\/btrfs\/free-space-cache.c:565)<br \/>\n  Read of size 8 at addr ffff88800c833a80 by task kworker\/u8:3\/58<br \/>\n   io_ctl_check_crc (fs\/btrfs\/free-space-cache.c:420 fs\/btrfs\/free-space-cache.c:565)<br \/>\n   __load_free_space_cache (fs\/btrfs\/free-space-cache.c:655 fs\/btrfs\/free-space-cache.c:820)<br \/>\n   load_free_space_cache (fs\/btrfs\/free-space-cache.c:1017)<br \/>\n   caching_thread (fs\/btrfs\/block-group.c:880)<br \/>\n   btrfs_work_helper (fs\/btrfs\/async-thread.c:312)<br \/>\n   process_one_work<br \/>\n   worker_thread<br \/>\n   kthread<br \/>\n   ret_from_fork<\/p>\n<p>free-space-cache.c:420 is io_ctl_map_page(), inlined into io_ctl_check_crc()<br \/>\nat line 565, which is why that is the frame KASAN names. The out-of-bounds<br \/>\nslot is then treated as a struct page and handed to crc32c(), so the bad<br \/>\nread turns into a GP fault.<\/p>\n<p>Add the missing check to io_ctl_check_crc(), which is where both the entry<br \/>\nloop and the bitmap loop end up. When num_entries is too large the load now<br \/>\nfails like any corrupt cache: __load_free_space_cache() drops it and rebuilds<br \/>\nthe free space from the extent tree, so a valid cache is never rejected.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>btrfs: reject free space cache with more entries than pages<\/p>\n<p>When loading a v1 free space cache, __load_free_space_cache() takes<br \/>\nnu<\/p>\n","protected":false},"template":"","meta":[],"categories":[],"tags":[],"class_list":["post-4647","vuln","type-vuln","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln\/4647","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=4647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}