CVE-2026-142870: fs/ntfs3: validate the EA value length in ntfs_read_ea()

Published Dec 3, 2026
·
Updated

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

fs/ntfs3: validate the EA value length in ntfsreadea()

ntfsreadea() checks the $EA list for consistency, but it only recomputes the packed size of an entry when the entry's own size field is zero:

for (off = 0; off < size; off += easize) { const struct EAFULL ef = Add2Ptr(eap, off); u32 bytes = size - off; ... if (ef->size) { easize = le32tocpu(ef->size); if (easize > bytes) goto out1; continue; / <- elength never checked / } ... easize = ALIGN(structsize(ef, name, 1 + ef->namelen + le16tocpu(ef->elength)), 4); if (easize > bytes) goto out1; }

ef->size is non-zero for every entry except the last one, and it is what ntfs3 itself writes (ntfssetea() stores exactly that aligned packed size), so in practice elength is not validated at all. findea() then uses unpackedeasize(), which also prefers ea->size when it is set, so it agrees and hands the entry back.

ntfsgetea() copies elength bytes with no further bound of its own:

len = le16tocpu(ea->elength); ... if (len > size) { / size is the caller's buffer / err = -ERANGE; ... } memcpy(buffer, ea->name + ea->namelen + 1, len);

so a caller that supplies a large enough buffer receives up to 64 KiB of whatever follows the small $EA allocation -- straight to userspace via getxattr(2).

Compute the packed size unconditionally and require it to fit in the entry. Hoist the "bytes < offsetof(struct EAFULL, name)" test above the ef->size branch as well: namelen and elength were being read there without it, which is itself a small over-read of the kmalloc'd buffer when fewer than 8 bytes are left. The old "bytes < sizeof(ef->size)" test is subsumed by it.

# mkntfs image; create /mnt/ntfs/poc with user.ntfs6 set, then rewrite # that EAFULL's elength from 0xf to 0xff00 on the raw device mount -t ntfs3 -o ro /dev/vda /mnt/ntfs getxattr("/mnt/ntfs/poc", "user.ntfs6", buf, 128 1024);

BUG: KASAN: slab-out-of-bounds in ntfsgetea+0x294/0x3e0 Read of size 65280 at addr ffff0000cca53acf by task xattrprobe/142 asanmemcpy+0x3c/0xa0 ntfsgetea+0x294/0x3e0 ntfsgetxattr+0x284/0x318 vfsgetxattr+0x104/0x160 vfsgetxattr+0x1b4/0x1e0 dogetxattr+0xcc/0x230 pathgetxattrat+0x184/0x270 arm64sysgetxattr+0x64/0x80 Allocated by task 142: kmallocnoprof+0x294/0x668 ntfsreadea+0x1e4/0x420 ntfsgetea+0x2c8/0x3e0 The buggy address belongs to the object at ffff0000cca53a80 which belongs to the cache kmalloc-96 of size 96

The object being over-read is the one ntfsreadea() just allocated, and it is 96 bytes.

Entries written by ntfs3 and by Windows set size to the aligned packed size, so the new test does not reject anything a working filesystem produces.

[almaz.alexandrovich@paragon-software.com: applied as-is, logic is the same but the code is cleaner]

Affected Software

7 affected componentsFixes available
Linux Linux kernel (ntfs3 filesystem driver)
linux/kernel>=5.15.0<5.15.226
5.15.226
linux/kernel>=5.16.0<6.1.193
6.1.193
linux/kernel>=6.2.0<6.6.163
6.6.163
linux/kernel>=6.7.0<6.12.118
6.12.118
linux/kernel>=6.13.0<6.18.64
6.18.64
linux/kernel>=6.19.0<7.3.5
7.3.5

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 5.15.226
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.1.193
  3. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.6.163
  4. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.12.118
  5. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18.64
  6. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.5
  7. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch fs/ntfs3: validate the EA value length in ntfs_read_ea()

Event History

Dec 3, 2026
CVE Published
via MITRE·03:23 AM
Data Sourced
via MITRE·03:23 AM
Description
Data Sourced
via OSV·03:23 AM
DescriptionAffected Software
Data Sourced
via NVD·04:18 AM
Description

Frequently Asked Questions

1

When does the extended-attribute length avoid validation?

The length in elength is not recomputed or checked when an EA entry has a non-zero size field. Non-final entries normally have a non-zero size field, including entries written by ntfs3 itself.

2

Why do the existing EA-list checks not reject this condition?

ntfs_read_ea() accepts a non-zero entry size as long as it does not exceed the remaining bytes in the EA list. find_ea() also prefers that size field, so it can return the entry without validating elength.

3

What happens when the EA value is retrieved?

ntfs_get_ea() uses elength as the copy length and performs memcpy from the EA value location. Its length comparison is against the caller's buffer size, not against the bounds of the EA entry.

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