CVE-2026-64567: btrfs: reject free space cache with more entries than pages

Published Aug 5, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

btrfs: reject free space cache with more entries than pages

When loading a v1 free space cache, loadfreespacecache() takes numentries and numbitmaps straight from the on-disk btrfsfreespaceheader. That header is stored in the treeroot under a key with type 0, which the tree-checker has no case for, so neither count is validated before the load trusts it.

The load loops numentries times and maps the next page whenever the current one runs out, going through ioctlcheckcrc() -> ioctlmappage(), which does ioctl->pages[ioctl->index++]. But pages[] is allocated in ioctlinit() from the cache inode's isize, not from numentries:

numpages = DIVROUNDUP(isizeread(inode), PAGESIZE); ioctl->pages = kcalloc(numpages, sizeof(struct page ), GFPNOFS);

So if numentries claims more records than the pages can hold, ioctl->index runs off the end of pages[]. The write side never hits this because ioctladdentry() and ioctladdbitmap() both stop once ioctl->index >= ioctl->numpages; the read side just never had the same check.

To trigger it, take a clean cache (numentries = <N> here), set numentries in the header to 0x10000, and fix up the leaf checksum so it still passes the tree-checker. The cache inode has isize = 65536, so numpages is 16 and pages[] is a 16-pointer (kmalloc-128) array. The load now tries to read 65536 entries, ioctl->index walks up to 16, and pages[16] is read past the array:

BUG: KASAN: slab-out-of-bounds in ioctlcheckcrc (fs/btrfs/free-space-cache.c:420 fs/btrfs/free-space-cache.c:565) Read of size 8 at addr ffff88800c833a80 by task kworker/u8:3/58 ioctlcheckcrc (fs/btrfs/free-space-cache.c:420 fs/btrfs/free-space-cache.c:565) loadfreespacecache (fs/btrfs/free-space-cache.c:655 fs/btrfs/free-space-cache.c:820) loadfreespacecache (fs/btrfs/free-space-cache.c:1017) cachingthread (fs/btrfs/block-group.c:880) btrfsworkhelper (fs/btrfs/async-thread.c:312) processonework workerthread kthread retfromfork

free-space-cache.c:420 is ioctlmappage(), inlined into ioctlcheckcrc() at line 565, which is why that is the frame KASAN names. The out-of-bounds slot is then treated as a struct page and handed to crc32c(), so the bad read turns into a GP fault.

Add the missing check to ioctlcheckcrc(), which is where both the entry loop and the bitmap loop end up. When numentries is too large the load now fails like any corrupt cache: loadfreespacecache() drops it and rebuilds the free space from the extent tree, so a valid cache is never rejected.

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    In __load_free_space_cache()/io_ctl_check_crc(), add the missing bounds check so that io_ctl->index never allows accessing beyond io_ctl->pages; specifically ensure io_ctl->index >= io_ctl->num_pages is handled by rejecting the cache and triggering rebuild. Apply the fix referenced in the resolved issue 'btrfs: reject free space cache with more entries than pages'.

    btrfs free-space cache loader Reject free space cache when num_entries exceeds available pages = if num_entries > num_pages then fail validation (drop and rebuild cache)
  2. Operational

    If a corrupt free-space cache is rejected by __load_free_space_cache(), the loader should drop it and rebuild the free-space cache (as described in the text).

Event History

Aug 5, 2026
CVE Published
via MITRE·08:08 AM
Data Sourced
via MITRE·08:08 AM
Description
Data Sourced
via NVD·08:16 AM
Description
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-64567?

CVE-2026-64567 has a risk score of 27, indicating a potentially serious vulnerability.

2

How do I fix CVE-2026-64567?

To mitigate CVE-2026-64567, update your Linux kernel to the latest version where this vulnerability has been resolved.

3

What system does CVE-2026-64567 affect?

CVE-2026-64567 affects the Linux kernel specifically within the btrfs file system.

4

What does CVE-2026-64567 involve?

CVE-2026-64567 involves rejecting a free space cache that has more entries than the available pages.

5

When was CVE-2026-64567 published?

CVE-2026-64567 was published on August 5, 2026.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203