Linux Kernel Out-of-Bounds Read Vulnerability in ext4 File System

Vulnerability

A vulnerability in the Linux kernel's ext4 file system can lead to an out-of-bounds read. This issue arises when a corrupted filesystem is mounted, specifically one that contains a directory with a '.' directory entry whose rec_len equals the block size. The problem occurs because the ext4_empty_dir() function assumes that every directory has at least '.' and '..' entries in the first data block. When the rec_len of '.' is exactly one block, it bypasses sanity checks and causes a pointer to reference memory just past the allocated slot, leading to out-of-bounds access. This vulnerability was identified by the syzkaller tool and is reported as a use-after-free issue by KASAN, although it primarily involves an out-of-bounds read.

Impact

Exploitation of this vulnerability causes a use-after-free error, which can lead to memory corruption.

Reproduction

To reproduce this vulnerability, mount a corrupted ext4 filesystem that includes a directory with a '.' entry having a rec_len equal to the block size. Once the filesystem is mounted, remove the corrupted directory. The ext4_empty_dir() function will then misinterpret the directory entries, allowing the vulnerability to manifest as an out-of-bounds read.

Remediation

Users should ensure that their filesystems are not corrupted and avoid mounting such filesystems until they can be repaired.

Added: Jun 9, 2025, 7:46 PM
Updated: Jun 9, 2025, 7:46 PM

Vulnerability Rating

Custom Algorithm
spread
9.0
impact
0.6
exploitability
4.3
remediation
0.0
relevance
0.0
threat
4.8
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.