Re: [PATCH] ntfs: Fix null pointer dereference
From: Namjae Jeon
Date: Thu Feb 26 2026 - 04:42:51 EST
On Thu, Feb 26, 2026 at 7:25 AM Ethan Tidmore <ethantidmore06@xxxxxxxxx> wrote:
>
> The variable ctx can be null and once confirmed to be null in its error
> path goes to label err_out. Once there it can be immediately dereferenced
> by the function ntfs_attr_put_search_ctx() which has no null pointer check.
>
> Detected by Smatch:
> fs/ntfs/ea.c:687 ntfs_new_attr_flags() error:
> we previously assumed 'ctx' could be null (see line 577)
>
> Add null pointer check before running ntfs_attr_put_search_ctx() in
> error path.
>
> Fixes: fc053f05ca282 ("ntfs: add reparse and ea operations")
> Signed-off-by: Ethan Tidmore <ethantidmore06@xxxxxxxxx>
Applied it to #ntfs-next.
Thanks!