Re: [PATCH v2] ntfs: fix hole runlist memory leak in insert range error path

From: Namjae Jeon

Date: Mon Jul 06 2026 - 07:50:12 EST


On Sun, Jul 5, 2026 at 8:14 PM Peiyang He <peiyang_he@xxxxxxxxxxxxxxxx> wrote:
>
> ntfs_non_resident_attr_insert_range() allocates hole_rl before mapping the
> whole runlist. If ntfs_attr_map_whole_runlist() fails, the error path drops
> ni->runlist.lock and returns without freeing hole_rl. This leaks memory
> of sizeof(*hole_rl) * 2 bytes.
>
> Fix this memory leak by freeing hole_rl before returning from
> that error path, matching the later error paths in the same function.
>
> Fixes: 495e90fa3348 ("ntfs: update attrib operations")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Peiyang He <peiyang_he@xxxxxxxxxxxxxxxx>
Applied it to #ntfs-next.
Thanks!