Re: [PATCH 0/4] ntfs: serialize attribute-list access

Namjae Jeon <[email protected]> Mon, 27 Jul 2026 18:19:14 +0900
Newsgroups dev.linux.lists.ntfs
Message-ID <CAKYAXd9KwVD8RB4pB9KM1ayx_FT1Mw+xH_rqQkWmmJKZcWiwSw@mail.gmail.com>
On Mon, Jul 27, 2026 at 9:59=E2=80=AFAM Hyunchul Lee <[email protected]> wr=
ote:
>
> ntfs_external_attr_find() walks base_ni->attr_list using raw
> attr_list_entry pointers stored in ctx->al_entry.  Because other paths
> can replace base_ni->attr_list and free the old buffer while a lookup
> still holds one of those cursors, a concurrent attribute-list mutation
> can turn a saved cursor into a stale or freed pointer.
>
> Reported in:
>   https://lore.kernel.org/all/[email protected]=
m/
>
> This series fixes that hazard by replacing the raw ctx->al_entry
> pointer with restartable, generation-checked locators, and by adding
> locks that serialize attribute-list buffer replacement and on-disk
> persistence so concurrent mutations cannot corrupt state or double-free
> memory.
>
> The four patches are:
>
>   1. ntfs: replace raw ctx->al_entry with restartable attr-list locators
>   2. ntfs: protect attribute-list buffer replacement with
>      attr_list_persist_lock
>   3. ntfs: protect attribute-list creation/teardown with
>      attr_list_persist_lock
>   4. ntfs: protect mapping-pairs attr-list updates with
>      attr_list_persist_lock
Please add Fixes tags to the patches.
Thanks!