Re: [PATCH v3] ntfs: validate non-resident attribute offsets
From: Namjae Jeon
Date: Thu Aug 06 2026 - 09:17:22 EST
> + /* Ensure there's room for the compressed_size field if needed. */
> + if (!(a->flags & ATTR_IS_SPARSE) &&
> + !(a->flags & ATTR_IS_COMPRESSED) &&
> + attr_len - mp_offset < sizeof(a->data.non_resident.compressed_size))
> + return false;
Sorry for the confusion. I rechecked the code and realized that
ATTR_COMPRESSION_MASK is correct here. It covers the entire
compression field, while ATTR_IS_COMPRESSED checks only the 0x0001
bit. Since this validation checks whether the attribute layout
includes compressed_size, it should use the mask, consistent with the
existing min_len check. So I have applied the previously attached
patch.
Thanks!