Re: [PATCH] ntfs: fix memmove overlap in ntfs_new_attr_flags

From: Namjae Jeon

Date: Thu Aug 27 2026 - 09:07:52 EST


On Mon, Aug 24, 2026 at 4:59 PM Hongling Zeng <zenghongling@xxxxxxxxxx> wrote:
>
> When the record shrinks while the payload offsets increase (e.g., enabling
> compression reduces padding, making arec_size < old_arec_size, but the header
> grows by 8 bytes), moving the name first can overwrite the old mapping_pairs
> before they are copied. Move mapping_pairs first in this case.
>
> Since mp_ofs is derived from name_ofs, they always change in the same
> direction. Checking name_ofs alone is sufficient.
>
> Fixes: fc053f05ca28 ("ntfs: add reparse and ea operations")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Hongling Zeng <zenghongling@xxxxxxxxxx>
Applied it to #ntfs-next.
Thanks!