KernelScan.io

CRITICAL

iomap Folio UAF

CVE-2026-31463

CVSS 9.8 / 10.0 NVD

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

KernelScan AI6.3MEDIUM

01

In the Linux kernel, the following vulnerability has been resolved: iomap: fix invalid folio access when i_blkbits differs from I/O granularity Commit aa35dd5cbc06 ("iomap: fix invalid folio access after folio_end_read()") partially addressed invalid folio access for folios without an ifs attached, but it did not handle the case where 1 << inode->i_blkbits matches the folio size but is different from the granularity used for the IO, which means IO can be submitted for less than the full folio for the !ifs case. In this case, the condition: if (*bytes_submitted == folio_len) ctx->cur_folio = NULL; in iomap_read_folio_iter() will not invalidate ctx->cur_folio, and iomap_read_end() will still be called on the folio even though the IO helper owns it and will finish the read on it. Fix this by unconditionally invalidating ctx->cur_folio for the !ifs case.

02

Engine v0.2.0

Risk summary

A use-after-free vulnerability in the iomap buffered I/O subsystem can lead to memory corruption when filesystem block size differs from I/O granularity. Local users performing file operations on affected filesystems may trigger kernel crashes or potential privilege escalation. Systems using XFS, ext4, or other iomap-based filesystems with specific block size configurations are at risk.

Affectedfs/iomap/buffered-io.c (iomap)

Vulnerability analysis

The vulnerability stems from incorrect folio ownership management in iomap_read_folio_iter(). When a folio lacks an ifs structure and partial I/O is submitted due to block size/I/O granularity mismatch, the code fails to invalidate ctx->cur_folio, leading to double ownership between the iomap layer and I/O helper. The fix ensures proper handoff by unconditionally clearing ctx->cur_folio for !ifs cases. This affects local users who can perform filesystem operations, requiring specific filesystem configurations to trigger the vulnerable code path.

03

BranchFixed inPatch commit
6.196.19.114a927f670cdb
mainline7.0bd71fb3fea99