Re: [PATCH] ntfs: fix resource leak in ntfs_new_attr_flags
Namjae Jeon <[email protected]>
| Newsgroups | dev.linux.lists.ntfs,org.kernel.vger.linux-kernel,org.kernel.vger.stable |
|---|---|
| Message-ID | <CAKYAXd9K-foqh6sd6ncmG-vKObkw7Gy8V7XRABMQ7YOCtcLnFg@mail.gmail.com> |
On Thu, Aug 20, 2026 at 5:14 PM Hongling Zeng <[email protected]> wrote: > > When handling resident attributes that don't need sparse/compressed > changes, ntfs_new_attr_flags() returns 0 directly at line 678 without > calling unmap_mft_record() or ntfs_attr_put_search_ctx(). This leaks > the MFT record mapping and attribute search context. > > An unprivileged user can cause a denial of service by repeatedly > calling setxattr(2) with system.ntfs_attrib on files with resident > attributes, eventually exhausting kernel memory. > > Fix by replacing the direct return with goto err_out to ensure proper > cleanup of resources via the existing cleanup code. > > Fixes: e791930240a5 ("ntfs: fix resident conversion in ntfs_new_attr_flags") > Cc: [email protected] > Signed-off-by: Hongling Zeng <[email protected]> Applied it to #ntfs-next. Thanks!