VYPR
Unrated severityNVD Advisory· Published Feb 14, 2026· Updated Apr 15, 2026

CVE-2026-23181

CVE-2026-23181

Description

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 mapping_min_folio_order() calculation.

Let's analyze the following two scenarios:

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

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

do_read_cache_folio() 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 mapping_min_folio_order() calculation result becomes 2.

This leads to two undesirable consequences:

1. filemap_add_folio() triggers a VM_BUG_ON_FOLIO(folio_order(folio) < mapping_min_folio_order(mapping)) assertion.

2. The syzbot report [1] shows a null pointer dereference in create_empty_buffers() 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:create_empty_buffers+0x4d/0x480 fs/buffer.c:1694 Call Trace: folio_create_buffers+0x109/0x150 fs/buffer.c:1802 block_read_full_folio+0x14c/0x850 fs/buffer.c:2403 filemap_read_folio+0xc8/0x2a0 mm/filemap.c:2496 do_read_cache_folio+0x266/0x5c0 mm/filemap.c:4096 do_read_cache_page mm/filemap.c:4162 [inline] read_cache_page_gfp+0x29/0x120 mm/filemap.c:4195 btrfs_read_disk_super+0x192/0x500 fs/btrfs/volumes.c:1367

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

A race condition in btrfs mount between BLKBSZSET and disk super block read can cause a kernel crash due to mismatched folio order.

Root

Cause

When mounting a btrfs filesystem, the kernel reads the disk super block via btrfs_read_disk_super(), which calls do_read_cache_folio(). This function allocates a folio based on the current block size of the block device. If a user concurrently changes the block size using the BLKBSZSET ioctl (e.g., from 0x1000 to 0x4000), the folio order may become too small for the new block size. This inconsistency triggers a VM_BUG_ON_FOLIO assertion in filemap_add_folio() or a null pointer dereference in create_empty_buffers() due to a buffer head allocation failure [1].

Exploitation

The vulnerability requires local access with sufficient privileges to issue BLKBSZSET on the block device (typically root or CAP_SYS_ADMIN). The attacker must also be able to mount a btrfs filesystem. By timing the BLKBSZSET command during the mount operation, the attacker can cause the kernel to allocate a folio with an order that is too small for the subsequent block size, leading to a crash.

Impact

Successful exploitation results in a kernel panic or null pointer dereference, causing a denial of service (system crash). The syzbot report [1] demonstrates a null-ptr-deref in create_empty_buffers at fs/buffer.c:1694.

Mitigation

The fix is included in the Linux kernel stable commit referenced in [1]. It introduces proper synchronization between the block size change and the read cache page operation, ensuring that the folio allocation is consistent with the current block size. Users should apply the latest kernel updates to mitigate this vulnerability.

AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

2
  • Linux/Kernelllm-fuzzy
    Range: < 6.y (fix commit 3f29d661e5686f3aa14e6f11537ff5c49846f2e2)
  • btrfs/btrfsllm-fuzzy

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

2

News mentions

0

No linked articles in our index yet.