* [PATCH] ntfs3: fix memory leak in indx_create_allocate()
@ 2026-03-21 5:01 Deepanshu Kartikey
0 siblings, 0 replies; 5+ messages in thread
From: Deepanshu Kartikey @ 2026-03-21 5:01 UTC (permalink / raw)
To: almaz.alexandrovich
Cc: ntfs3, linux-kernel, Deepanshu Kartikey,
syzbot+7adcddaeeb860e5d3f2f, Deepanshu Kartikey
When indx_create_allocate() fails after
attr_allocate_clusters() succeeds, run_deallocate()
frees the disk clusters but never frees the memory
allocated by run_add_entry() via kvmalloc() for the
runs_tree structure.
Fix this by adding run_close() at the out: label to
free the run.runs memory on all error paths. The
success path is unaffected as it returns 0 directly
without going through out:, transferring ownership
of the run memory to indx->alloc_run via memcpy().
Reported-by: syzbot+7adcddaeeb860e5d3f2f@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=7adcddaeeb860e5d3f2f
Signed-off-by: Deepanshu Kartikey <Kartikey406@gmail.com>
---
fs/ntfs3/index.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c
index 97f06c26fe1a..11f59d7b9ea4 100644
--- a/fs/ntfs3/index.c
+++ b/fs/ntfs3/index.c
@@ -1481,6 +1481,7 @@ static int indx_create_allocate(struct ntfs_index *indx, struct ntfs_inode *ni,
run_deallocate(sbi, &run, false);
out:
+ run_close(&run);
return err;
}
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ntfs3: fix memory leak in indx_create_allocate()
@ 2026-03-23 5:21 Deepanshu Kartikey
2026-03-31 8:49 ` Deepanshu Kartikey
0 siblings, 1 reply; 5+ messages in thread
From: Deepanshu Kartikey @ 2026-03-23 5:21 UTC (permalink / raw)
To: almaz.alexandrovich
Cc: ntfs3, linux-kernel, Deepanshu Kartikey,
syzbot+7adcddaeeb860e5d3f2f, Deepanshu Kartikey
When indx_create_allocate() fails after
attr_allocate_clusters() succeeds, run_deallocate()
frees the disk clusters but never frees the memory
allocated by run_add_entry() via kvmalloc() for the
runs_tree structure.
Fix this by adding run_close() at the out: label to
free the run.runs memory on all error paths. The
success path is unaffected as it returns 0 directly
without going through out:, transferring ownership
of the run memory to indx->alloc_run via memcpy().
Reported-by: syzbot+7adcddaeeb860e5d3f2f@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=7adcddaeeb860e5d3f2f
Signed-off-by: Deepanshu Kartikey <Kartikey406@gmail.com>
---
fs/ntfs3/index.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c
index 97f06c26fe1a..11f59d7b9ea4 100644
--- a/fs/ntfs3/index.c
+++ b/fs/ntfs3/index.c
@@ -1481,6 +1481,7 @@ static int indx_create_allocate(struct ntfs_index *indx, struct ntfs_inode *ni,
run_deallocate(sbi, &run, false);
out:
+ run_close(&run);
return err;
}
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ntfs3: fix memory leak in indx_create_allocate()
2026-03-23 5:21 Deepanshu Kartikey
@ 2026-03-31 8:49 ` Deepanshu Kartikey
2026-04-01 18:21 ` Konstantin Komarov
2026-04-02 18:25 ` Konstantin Komarov
0 siblings, 2 replies; 5+ messages in thread
From: Deepanshu Kartikey @ 2026-03-31 8:49 UTC (permalink / raw)
To: almaz.alexandrovich; +Cc: ntfs3, linux-kernel, syzbot+7adcddaeeb860e5d3f2f
On Mon, Mar 23, 2026 at 10:51 AM Deepanshu Kartikey
<kartikey406@gmail.com> wrote:
>
> When indx_create_allocate() fails after
> attr_allocate_clusters() succeeds, run_deallocate()
> frees the disk clusters but never frees the memory
> allocated by run_add_entry() via kvmalloc() for the
> runs_tree structure.
>
> Fix this by adding run_close() at the out: label to
> free the run.runs memory on all error paths. The
> success path is unaffected as it returns 0 directly
> without going through out:, transferring ownership
> of the run memory to indx->alloc_run via memcpy().
>
> Reported-by: syzbot+7adcddaeeb860e5d3f2f@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=7adcddaeeb860e5d3f2f
> Signed-off-by: Deepanshu Kartikey <Kartikey406@gmail.com>
> ---
> fs/ntfs3/index.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c
> index 97f06c26fe1a..11f59d7b9ea4 100644
> --- a/fs/ntfs3/index.c
> +++ b/fs/ntfs3/index.c
> @@ -1481,6 +1481,7 @@ static int indx_create_allocate(struct ntfs_index *indx, struct ntfs_inode *ni,
> run_deallocate(sbi, &run, false);
>
> out:
> + run_close(&run);
> return err;
> }
>
> --
> 2.43.0
>
Hi Almaz,
Gentle ping on this patch . I have submitted this patch on 23 March
2026 and this patch has been tested by sysbot.
Please let me know if anything else required
Thanks
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ntfs3: fix memory leak in indx_create_allocate()
2026-03-31 8:49 ` Deepanshu Kartikey
@ 2026-04-01 18:21 ` Konstantin Komarov
2026-04-02 18:25 ` Konstantin Komarov
1 sibling, 0 replies; 5+ messages in thread
From: Konstantin Komarov @ 2026-04-01 18:21 UTC (permalink / raw)
To: Deepanshu Kartikey; +Cc: ntfs3, linux-kernel, syzbot+7adcddaeeb860e5d3f2f
On 3/31/26 10:49, Deepanshu Kartikey wrote:
> On Mon, Mar 23, 2026 at 10:51 AM Deepanshu Kartikey
> <kartikey406@gmail.com> wrote:
>> When indx_create_allocate() fails after
>> attr_allocate_clusters() succeeds, run_deallocate()
>> frees the disk clusters but never frees the memory
>> allocated by run_add_entry() via kvmalloc() for the
>> runs_tree structure.
>>
>> Fix this by adding run_close() at the out: label to
>> free the run.runs memory on all error paths. The
>> success path is unaffected as it returns 0 directly
>> without going through out:, transferring ownership
>> of the run memory to indx->alloc_run via memcpy().
>>
>> Reported-by: syzbot+7adcddaeeb860e5d3f2f@syzkaller.appspotmail.com
>> Closes: https://syzkaller.appspot.com/bug?extid=7adcddaeeb860e5d3f2f
>> Signed-off-by: Deepanshu Kartikey <Kartikey406@gmail.com>
>> ---
>> fs/ntfs3/index.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c
>> index 97f06c26fe1a..11f59d7b9ea4 100644
>> --- a/fs/ntfs3/index.c
>> +++ b/fs/ntfs3/index.c
>> @@ -1481,6 +1481,7 @@ static int indx_create_allocate(struct ntfs_index *indx, struct ntfs_inode *ni,
>> run_deallocate(sbi, &run, false);
>>
>> out:
>> + run_close(&run);
>> return err;
>> }
>>
>> --
>> 2.43.0
>>
> Hi Almaz,
>
> Gentle ping on this patch . I have submitted this patch on 23 March
> 2026 and this patch has been tested by sysbot.
>
> Please let me know if anything else required
>
> Thanks
Hello,
Your patch is being tested internally. I’ll follow up with
feedback in the next few days.
Regards,
Konstantin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ntfs3: fix memory leak in indx_create_allocate()
2026-03-31 8:49 ` Deepanshu Kartikey
2026-04-01 18:21 ` Konstantin Komarov
@ 2026-04-02 18:25 ` Konstantin Komarov
1 sibling, 0 replies; 5+ messages in thread
From: Konstantin Komarov @ 2026-04-02 18:25 UTC (permalink / raw)
To: Deepanshu Kartikey; +Cc: ntfs3, linux-kernel, syzbot+7adcddaeeb860e5d3f2f
On 3/31/26 10:49, Deepanshu Kartikey wrote:
> On Mon, Mar 23, 2026 at 10:51 AM Deepanshu Kartikey
> <kartikey406@gmail.com> wrote:
>> When indx_create_allocate() fails after
>> attr_allocate_clusters() succeeds, run_deallocate()
>> frees the disk clusters but never frees the memory
>> allocated by run_add_entry() via kvmalloc() for the
>> runs_tree structure.
>>
>> Fix this by adding run_close() at the out: label to
>> free the run.runs memory on all error paths. The
>> success path is unaffected as it returns 0 directly
>> without going through out:, transferring ownership
>> of the run memory to indx->alloc_run via memcpy().
>>
>> Reported-by: syzbot+7adcddaeeb860e5d3f2f@syzkaller.appspotmail.com
>> Closes: https://syzkaller.appspot.com/bug?extid=7adcddaeeb860e5d3f2f
>> Signed-off-by: Deepanshu Kartikey <Kartikey406@gmail.com>
>> ---
>> fs/ntfs3/index.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c
>> index 97f06c26fe1a..11f59d7b9ea4 100644
>> --- a/fs/ntfs3/index.c
>> +++ b/fs/ntfs3/index.c
>> @@ -1481,6 +1481,7 @@ static int indx_create_allocate(struct ntfs_index *indx, struct ntfs_inode *ni,
>> run_deallocate(sbi, &run, false);
>>
>> out:
>> + run_close(&run);
>> return err;
>> }
>>
>> --
>> 2.43.0
>>
> Hi Almaz,
>
> Gentle ping on this patch . I have submitted this patch on 23 March
> 2026 and this patch has been tested by sysbot.
>
> Please let me know if anything else required
>
> Thanks
Hello,
Your patch is applied, thanks for your work.
Regards,
Konstantin
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-04-02 18:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-21 5:01 [PATCH] ntfs3: fix memory leak in indx_create_allocate() Deepanshu Kartikey
2026-03-23 5:21 Deepanshu Kartikey
2026-03-31 8:49 ` Deepanshu Kartikey
2026-04-01 18:21 ` Konstantin Komarov
2026-04-02 18:25 ` Konstantin Komarov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®