KernelScan.io

HIGH Introduced in 5.15

ntfs3 DirEntry OOB

CVE-2026-97437

CVSS 7.1 / 10.0 NVD

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

KernelScan AI6.1MEDIUM

01

In the Linux kernel, the following vulnerability has been resolved: ntfs3: fix out-of-bounds read in ntfs_dir_emit() and hdr_find_e() The bounds check in ntfs_dir_emit() compares fname->name_len (a character count) against e->size (a byte count) without accounting for the 2-byte-per-character UTF-16LE encoding or the ATTR_FILE_NAME header size: if (fname->name_len + sizeof(struct NTFS_DE) > le16_to_cpu(e->size)) This computes: name_len + 16 > e_size The correct check must account for the ATTR_FILE_NAME header (66 bytes before the name) and the UTF-16LE character size (2 bytes each): sizeof(NTFS_DE) + offsetof(ATTR_FILE_NAME, name) + name_len * sizeof(short) > e_size Which computes: 16 + 66 + name_len * 2 > e_size The correct calculation already exists as fname_full_size() in ntfs.h and is used in cmp_fnames(), namei.c, and fslog.c, but was not used in the readdir path. A crafted NTFS image with an index entry containing a small e->size but large fname->name_len bypasses the current check, causing ntfs_utf16_to_nls() to read past the entry boundary. Additionally, add a key_size validation in hdr_find_e() to ensure the declared key_size does not exceed the available entry data, preventing comparison functions from reading past entry boundaries on the lookup path.

02

Engine v0.6.0

Risk summary

A crafted NTFS filesystem image can cause the kernel to read past directory entry and index lookup boundaries due to incorrect bounds checks that confuse character counts with byte counts. The bug is triggered whenever the kernel parses the malformed image — during directory listing or file lookup — leaking kernel memory or causing a crash. The primary attack vector is physical media insertion (USB/SD), though a privileged user manually mounting a crafted image file is also a viable path.

Affectedfs/ntfs3/dir.c, fs/ntfs3/index.c (ntfs3 filesystem driver)

Vulnerability analysis

The NTFS3 filesystem driver's directory listing and index lookup code perform bounds checks that compare a UTF-16 character count against a byte count without accounting for the 2-byte-per-character encoding or the file-name header size, so a crafted NTFS image with an entry declaring a large name length but a small entry size bypasses the check and causes the kernel to read past the entry boundary. A separate issue in the index lookup path allows an oversized key-length field to drive comparison functions to read well beyond entry data. The fix replaces the incorrect check with the proper full-size calculation already used elsewhere in the driver and adds validation that the declared key length fits within the entry. The vulnerability is reachable by mounting a crafted NTFS filesystem image, which can be delivered via removable media such as a USB drive or SD card, or manually mounted by a privileged user.

03

BranchIntroducedFixed inPatch commit
5.155.155.15.222d1f98938e437
6.15.156.1.1890505f1e7bb5b
6.65.156.6.1582f7d0ec8c10d
6.125.156.12.111ed6da1abeec5
6.185.156.18.536a8149a20e46
mainline5.157.2aa1bdbb39f49
cip/6.125.156.12.111-cip32ed6da1abeec5