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

From: liubaolin

Date: Mon Sep 21 2026 - 06:40:20 EST




在 2026/9/21 14:17, Namjae Jeon 写道:
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.

Hi Namjae,

Thanks for your feedback. I've updated ntfs_listxattr() to reuse the full-chain validation and return -EUCLEAN for malformed EA structures,while preserving lower-level read errors.
I've submitted only this revised patch as v3, as requested. I verified that patches 3-10 of v2 still apply cleanly without modification, and completed build checks and QEMU tests covering normal and malformed EA lists.

Please see:
"[PATCH v3 02/10] ntfs: validate EA chains and link zero-terminated tails"

Thanks,
Baolin.