CVE-2026-80734: btrfs: initialize inode mapping flags for cached inodes

Published Sep 3, 2026
·
Updated

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

btrfs: initialize inode mapping flags for cached inodes

[BUG] When running generic/795 with 8K block size, 4K page size, the test always fails, triggering some ASSERT()s related to folio size:

795 (241074): dropcaches: 3 assertion failed: ISALIGNED(start, blocksize) && ISALIGNED(end + 1, blocksize), in extentio.c:1404 (blocksize=8192 root=262 ino=258 start=16826368 end=16830463 mapping min order=0) ------------[ cut here ]------------ kernel BUG at extentio.c:1404! Oops: invalid opcode: 0000 [#1] SMP CPU: 8 UID: 0 PID: 241105 Comm: fsstress Tainted: G OE 7.2.0-rc5-custom+ #442 PREEMPT(full) f4bfb352566f3949f29c233ce6f735050a03b245 Tainted: [O]=OOTMODULE, [E]=UNSIGNEDMODULE Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS unknown 02/02/2022 RIP: 0010:assertfoliorange.cold+0x3d/0x3f [btrfs] Call Trace: <TASK> btrfsreadfolio+0x9e/0x170 [btrfs 4cd1dd93b341b8ef766643f9512f4a86259567a3] prepareonefolio.constprop.0+0x104/0x2a0 [btrfs 4cd1dd93b341b8ef766643f9512f4a86259567a3] btrfsbufferedwrite+0x285/0xa50 [btrfs 4cd1dd93b341b8ef766643f9512f4a86259567a3] btrfsdowriteiter+0x1aa/0x210 [btrfs 4cd1dd93b341b8ef766643f9512f4a86259567a3] iterfilesplicewrite+0x31a/0x540 directspliceactor+0x53/0x170 splicedirecttoactor+0xe9/0x240 dosplicedirect+0x76/0xb0 vfscopyfilerange+0x1fd/0x630 x64syscopyfilerange+0xf9/0x220 dosyscall64+0xe1/0x790 entrySYSCALL64afterhwframe+0x4b/0x53 </TASK> ---[ end trace 0000000000000000 ]---

The ASSERT() itself is added by a later patch. The crash is triggered with that new debug patch, and without this fix.

[CAUSE] In the above case, the start 16826368 is properly 8K aligned, but the end (16830463 + 1) is not 8K aligned. Furthermore the mapping's minimal folio order is 0, not the expected 1 for 8K block size with 4K page size.

So this means some inodes do not have btrfssetinodemappingorder() called on it.

The missing btrfssetinodemappingorder() call happens for cached inodes, through the following events:

- btrfscreatenewinode() called for inode X Which properly sets minimal folio order for the VFS inode.

- btrfsupdateinode() called for inode X Which calls btrfsdelayedupdateinode() to create a delayednode into root->delayednodes xarray.

- Drop cache/memory pressure, evicting in-memory inode X Which evicted the inode X, but delayednode is still in root->delayednodes for future reuse.

- btrfsiget() for inode X called again

btrfsiget() |- btrfsigetlocked() | |- iget5lockedrcu() | Which creates a new vfsinode for btrfs, whose mapping still | has the minimal order as 0. | |- btrfsreadlockedinode() |- btrfsfillinode() | |- btrfsgetdelayednode() | Which found out the previous node, and use that delayed | node to initialize the new inode. | |- filled = true; |- if (filled) goto cacheindex; Which skips the btrfsupdateinodemappingflags() and btrfssetinodemappingorder() calls. So the inode still has minimal folio order set as 0, not the required 1.

Thus later page cache read will get a folio whose size is smaller than block size, as the mapping has its minimal folio order set as 0 not 1, then trigger the ASSERT().

[FIX] Move the btrfsupdateinodemappingflags() and btrfssetinodemappingorder() calls under cacheindex label, so that the mapping flags and minimal folio order is always set no matter if we have a cached inode.

Affected Software

1 affected component
Linux Linux kernel=

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade btrfs to a version that resolves this vulnerability.

    Patch 4cd1dd93b341b8ef766643f9512f4a86259567a3
  2. Configuration

    btrfs: initialize inode mapping flags for cached inodes so mapping flags and minimal folio order are always set; this prevents extent_io.c alignment assertions (blocksize=8192, mapping min order=0 causing IS_ALIGNED(...) failures) and the resulting BUG/ASSERT.

    btrfs inode mapping flags / minimal folio order = always initialize for cached inodes (ensure minimal folio order set to 1 when blocksize is 8192)

Event History

Sep 3, 2026
CVE Published
via MITRE·08:21 AM
Data Sourced
via MITRE·08:21 AM
Description

Frequently Asked Questions

1

Does this require a particular filesystem block size and page size combination?

The reported failure occurs with an 8K Btrfs block size and 4K page size. It involves cached inodes whose mapping flags were not initialized.

2

What signs would indicate that a system has encountered this issue?

The reported symptoms are folio-size-related alignment assertions in extent_io.c during Btrfs activity, followed by a kernel BUG and invalid-opcode Oops. The failure was observed while running generic/795, with fsstress in the call trace.

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