CVE-2026-89787: ext4: check dir entry fits before reading the hash trailer in ext4_search_dir()

Published Sep 16, 2026
·
Updated

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

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

For casefolded encrypted directories ext4 stores an 8-byte hash trailer after the name (EXT4DIRENTHASHES()), at an offset derived from de->namelen. On the sbnocasefoldcompatfallback() path ext4match() reads that trailer, but ext4searchdir()'s by-hand pre-check only tests de->name + de->namelen <= dlimit, which proves the name fits, not the rounded trailer. A crafted entry whose name ends at the block boundary passes the check while EXT4DIRENTHASHES(de) lands past the block end, so ext4match() 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 ext4match (fs/ext4/namei.c:1435) Read of size 4 at addr ffff888010458000 by task exploit Call Trace: ext4match (fs/ext4/namei.c:1435) ext4searchdir (fs/ext4/namei.c:1470) ext4findentry (fs/ext4/namei.c:1268 fs/ext4/namei.c:1632) ext4lookup (fs/ext4/namei.c:1703 fs/ext4/namei.c:1769) ... filenamelookup (fs/namei.c:2842) vfsstatx (fs/stat.c:353) dosysnewfstatat (fs/stat.c:538) dosyscall64 (arch/x86/entry/syscall64.c:94) entrySYSCALL64afterhwframe (arch/x86/entry/entry64.S:121)

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

Affected Software

1 affected component
The Linux Kernel Organization Linux kernel

Event History

Sep 16, 2026
CVE Published
via MITRE·08:48 AM
Data Sourced
via MITRE·08:48 AM
Description

Frequently Asked Questions

1

Which systems are exposed to this issue?

Systems using ext4 casefolded encrypted directories are exposed on the sb_no_casefold_compat_fallback() lookup path. The malformed directory entry must place its name at the directory-block boundary so that the hash trailer extends beyond the block.

2

What action triggers the out-of-bounds read?

An ordinary lookup of the crafted directory entry triggers ext4_search_dir() and can reach the out-of-bounds hash-trailer read in ext4_match(). The reported call path includes filename lookup and statx operations.

3

How could administrators identify a possible occurrence?

KASAN may report a use-after-free in ext4_match, with a read of size 4 and call frames including ext4_search_dir(), __ext4_find_entry(), and ext4_lookup(). The underlying condition is an out-of-bounds read past a directory block, even though the report may be classified as use-after-free depending on adjacent page contents.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203