CVE-2026-23181

Source
https://cve.org/CVERecord?id=CVE-2026-23181
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23181.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-23181
Downstream
Published
2026-02-14T16:27:12.137Z
Modified
2026-02-16T19:46:38.841095Z
Summary
btrfs: sync read disk super and set block size
Details

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

btrfs: sync read disk super and set block size

When the user performs a btrfs mount, the block device is not set correctly. The user sets the block size of the block device to 0x4000 by executing the BLKBSZSET command. Since the block size change also changes the mapping->flags value, this further affects the result of the mappingminfolio_order() calculation.

Let's analyze the following two scenarios:

Scenario 1: Without executing the BLKBSZSET command, the block size is 0x1000, and mappingminfolio_order() returns 0;

Scenario 2: After executing the BLKBSZSET command, the block size is 0x4000, and mappingminfolio_order() returns 2.

doreadcachefolio() allocates a folio before the BLKBSZSET command is executed. This results in the allocated folio having an order value of 0. Later, after BLKBSZSET is executed, the block size increases to 0x4000, and the mappingminfolioorder() calculation result becomes 2.

This leads to two undesirable consequences:

  1. filemapaddfolio() triggers a VMBUGONFOLIO(folioorder(folio) < mappingminfolio_order(mapping)) assertion.

  2. The syzbot report [1] shows a null pointer dereference in createemptybuffers() due to a buffer head allocation failure.

Synchronization should be established based on the inode between the BLKBSZSET command and read cache page to prevent inconsistencies in block size or mapping flags before and after folio allocation.

[1] KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] RIP: 0010:createemptybuffers+0x4d/0x480 fs/buffer.c:1694 Call Trace: foliocreatebuffers+0x109/0x150 fs/buffer.c:1802 blockreadfullfolio+0x14c/0x850 fs/buffer.c:2403 filemapreadfolio+0xc8/0x2a0 mm/filemap.c:2496 doreadcachefolio+0x266/0x5c0 mm/filemap.c:4096 doreadcachepage mm/filemap.c:4162 [inline] readcachepagegfp+0x29/0x120 mm/filemap.c:4195 btrfsreaddisk_super+0x192/0x500 fs/btrfs/volumes.c:1367

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/23xxx/CVE-2026-23181.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
3c20917120ce61f2a123ca0810293872f4c6b5a4
Fixed
ccb3c75d57039adb3170ae54a0d470e359705984
Fixed
3f29d661e5686f3aa14e6f11537ff5c49846f2e2

Affected versions

v6.*
v6.14
v6.14-rc2
v6.14-rc3
v6.14-rc4
v6.14-rc5
v6.14-rc6
v6.14-rc7
v6.15
v6.15-rc1
v6.15-rc2
v6.15-rc3
v6.15-rc4
v6.15-rc5
v6.15-rc6
v6.15-rc7
v6.16
v6.16-rc1
v6.16-rc2
v6.16-rc3
v6.16-rc4
v6.16-rc5
v6.16-rc6
v6.16-rc7
v6.17
v6.17-rc1
v6.17-rc2
v6.17-rc3
v6.17-rc4
v6.17-rc5
v6.17-rc6
v6.17-rc7
v6.18
v6.18-rc1
v6.18-rc2
v6.18-rc3
v6.18-rc4
v6.18-rc5
v6.18-rc6
v6.18-rc7
v6.18.1
v6.18.2
v6.18.3
v6.18.4
v6.18.5
v6.18.6
v6.18.7
v6.18.8
v6.18.9

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23181.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.15.0
Fixed
6.18.10

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23181.json"