KernelScan.io

HIGH

ext4 InlineData Panic

CVE-2026-31452

CVSS 7.8 / 10.0 NVD

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

KernelScan AI5.5MEDIUM

01

In the Linux kernel, the following vulnerability has been resolved: ext4: convert inline data to extents when truncate exceeds inline size Add a check in ext4_setattr() to convert files from inline data storage to extent-based storage when truncate() grows the file size beyond the inline capacity. This prevents the filesystem from entering an inconsistent state where the inline data flag is set but the file size exceeds what can be stored inline. Without this fix, the following sequence causes a kernel BUG_ON(): 1. Mount filesystem with inode that has inline flag set and small size 2. truncate(file, 50MB) - grows size but inline flag remains set 3. sendfile() attempts to write data 4. ext4_write_inline_data() hits BUG_ON(write_size > inline_capacity) The crash occurs because ext4_write_inline_data() expects inline storage to accommodate the write, but the actual inline capacity (~60 bytes for i_block + ~96 bytes for xattrs) is far smaller than the file size and write request. The fix checks if the new size from setattr exceeds the inode's actual inline capacity (EXT4_I(inode)->i_inline_size) and converts the file to extent-based storage before proceeding with the size change. This addresses the root cause by ensuring the inline data flag and file size remain consistent during truncate operations.

02

Engine v0.2.0

Risk summary

Local users with write access to ext4 filesystems can trigger a kernel panic by truncating files with inline data beyond their inline capacity. This causes a denial of service requiring system reboot. The vulnerability affects systems where users can perform file operations on ext4 filesystems with inline data enabled.

Affectedfs/ext4/inode.c (ext4 filesystem)

Vulnerability analysis

The root cause is a missing validation check in ext4_setattr() that allows truncate() operations to grow file sizes beyond inline data capacity without converting the storage format. When a file has the inline data flag set but its size exceeds the ~156 byte inline capacity, subsequent write operations via sendfile() trigger a BUG_ON() assertion in ext4_write_inline_data() because the write size exceeds inline capacity. The fix adds a proactive check during truncate operations to convert files from inline to extent-based storage when the new size would exceed inline capacity, preventing the inconsistent state that leads to the kernel panic. This is a local vulnerability requiring filesystem write access.

03

BranchFixed inPatch commit
5.105.10.253110d7ef60265
5.155.15.203f53a5d9f3292
6.16.1.168c047332be719
6.126.12.807920dcc571ce
6.186.18.2193cb2d103e5c
6.196.19.1107c1a31af182
6.66.6.131699bac4d4c95
mainline7.0ed9356a30e59