CVE-2026-89787 in Linuxinfo

Summary

by MITRE • 09/16/2026

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

ext4: check dir entry fits before reading the hash trailer in ext4_search_dir()

For casefolded encrypted directories ext4 stores an 8-byte hash trailer after the name (EXT4_DIRENT_HASHES()), at an offset derived from de->name_len. On the sb_no_casefold_compat_fallback() path ext4_match() reads that trailer, but ext4_search_dir()'s by-hand pre-check only tests de->name + de->name_len <= dlimit, which proves the name fits, not the rounded trailer. A crafted entry whose name ends at the block boundary passes the check while EXT4_DIRENT_HASHES(de) lands past the block end, so ext4_match() reads out of bounds on an ordinary lookup. KASAN reports it as a use-after-free when the page after the directory block holds a freed object:

BUG: KASAN: use-after-free in ext4_match (fs/ext4/namei.c:1435) Read of size 4 at addr ffff888010458000 by task exploit Call Trace: ext4_match (fs/ext4/namei.c:1435) ext4_search_dir (fs/ext4/namei.c:1470) __ext4_find_entry (fs/ext4/namei.c:1268 fs/ext4/namei.c:1632) ext4_lookup (fs/ext4/namei.c:1703 fs/ext4/namei.c:1769) ... filename_lookup (fs/namei.c:2842) vfs_statx (fs/stat.c:353) __do_sys_newfstatat (fs/stat.c:538) do_syscall_64 (arch/x86/entry/syscall_64.c:94) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)

Require, for hash-in-dirent directories, that the whole entry including the rounded trailer fits before calling ext4_match(). This is the same bound ext4_check_dir_entry() already enforces via ext4_dir_rec_len(), so no well-formed entry is rejected. The other caller, ext4_find_dest_de(), runs ext4_check_dir_entry() first and is unaffected.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 09/16/2026

The Linux kernel's ext4 filesystem implementation contains a critical out-of-bounds read vulnerability within the directory lookup mechanism for casefolded encrypted directories. This flaw arises from an insufficient boundary check in the ext4_search_dir function, which fails to account for the additional space required by hash trailers stored alongside directory entries. When operating on file systems with casefolding compatibility fallback enabled, ext4 stores an eight-byte hash trailer immediately following each entry's name field. The offset of this trailer is derived from the length of the entry's name component. While the system correctly verifies that the name itself fits within the allocated block boundaries, it neglects to verify that the subsequent hash trailer also resides entirely within those same limits. This oversight creates a scenario where a maliciously crafted directory entry can appear valid during initial validation but trigger an out-of-bounds memory access when the kernel attempts to read the hash data for comparison purposes.

The technical root cause lies in the disparity between two distinct checks performed by different functions within the ext4 codebase. The ext4_search_dir function performs a manual pre-check using only the name length and block limit, asserting that de->name plus de->name_len does not exceed dlimit. However, this check ignores the EXT4_DIRENT_HASHES size requirement. In contrast, other parts of the filesystem logic such as ext4_check_dir_entry utilize more comprehensive bounds checking via ext4_dir_rec_len which accounts for the full entry structure including trailers. When a crafted entry is designed so that its name ends exactly at or near the block boundary, it passes the insufficient pre-check in ext4_search_dir but causes subsequent operations to read past the end of the allocated memory page. This results in an out-of-bounds read operation that KASAN identifies as a use-after-free condition because the kernel accesses memory belonging to adjacent pages which may contain freed objects or unrelated data structures.

From an operational impact perspective, this vulnerability allows for potential information disclosure and system instability through local privilege escalation vectors if exploited by unprivileged users with access to directory lookups. An attacker could craft specific filenames within a casefolded encrypted directory structure to trigger the out-of-bounds read during standard file status operations like stat or lookup calls. The resulting memory corruption can lead to kernel panics, denial of service conditions, or potentially allow an attacker to leak sensitive information from adjacent kernel memory regions. Since this vulnerability affects fundamental filesystem operations used by many system utilities and applications, it poses a significant risk to the integrity and availability of systems running affected versions of the Linux kernel with ext4 file systems configured for casefolding support.

The remediation strategy involves modifying the boundary validation logic in ext4_search_dir to ensure that both the name component and its associated hash trailer fit within the directory block before proceeding with matching operations. By requiring that the entire entry structure including the rounded trailer fits inside the allocated space, the kernel prevents any out-of-bounds access attempts while maintaining compatibility with well-formed entries. This fix aligns ext4_search_dir's validation behavior with the existing robust checks performed by ext4_check_dir_entry and ext4_find_dest_de functions which already enforce these stricter bounds. The patch ensures that no legitimate directory entry is rejected due to overly restrictive checking, thereby preserving normal filesystem functionality while eliminating the security flaw.

This vulnerability maps directly to CWE-125 Out-of-bounds Read within common weakness enumeration standards as it involves reading memory beyond allocated boundaries. In terms of attack patterns and tactics, this issue relates to ATT&CK technique T1083 File and Directory Discovery where an attacker enumerates files or directories on a system. The exploitation path typically begins with local access allowing the creation of specially crafted directory entries followed by triggering lookups that cause kernel memory violations. System administrators should apply available kernel updates promptly to mitigate this risk especially in environments utilizing ext4 file systems with casefolding features enabled for encrypted data storage scenarios requiring strict compliance and security posture maintenance against potential exploitation attempts targeting filesystem layer vulnerabilities.

Responsible

Linux

Reservation

09/11/2026

Disclosure

09/16/2026

Moderation

accepted

CPE

ready

EPSS

0.00205

KEV

no

Activities

low

Sources

Do you need the next level of professionalism?

Upgrade your account now!