Re: [PATCH v2 02/10] ntfs: validate EA chains and link zero-terminated tails

From: Namjae Jeon

Date: Mon Sep 21 2026 - 02:18:12 EST


On Sun, Sep 20, 2026 at 5:31 PM Baolin Liu <liubaolin12138@xxxxxxx> wrote:
>
> From: Baolin Liu <liubaolin@xxxxxxxxxx>
>
> A zero next-entry offset terminates an EA list. Appending an entry
> without linking the old tail makes the new entry unreachable. Invalid
> entries are also treated as missing names, allowing setters to proceed
> on corrupt metadata.
>
> Validate the entire chain before modifying it and connect a zero tail
> to the append position. Check name terminators and retain the full tail
> span when removing an entry. Return EUCLEAN for malformed EA structures
> and inconsistent information lengths, preserving that error through the
> get and set paths. Keep ENOENT for a missing name and translate it to
> ENODATA only at the xattr read boundary. Preserve lower-level read errors.
Could ntfs_listxattr() reuse the same chain validation and return
-EUCLEAN for malformed EA structures? And you can send only this patch
for v3.
Thanks.