* [PATCH v1] ntfs: use kvfree when ascending an index tree
@ 2026-11-20 9:20 Dandan Wu
2026-11-20 9:27 ` liubaolin
0 siblings, 1 reply; 2+ messages in thread
From: Dandan Wu @ 2026-11-20 9:20 UTC (permalink / raw)
To: linkinjeon, hyc.lee, liubaolin12138; +Cc: ntfs, linux-kernel, Dandan Wu
From: Dandan Wu <wudandan@kylinos.cn>
ntfs_index_walk_down() allocates the index block with kvzalloc(), which
may return vmalloc memory. When traversal ascends back to the root,
ntfs_index_walk_up() passes that block to kfree(), which cannot free a
vmalloc allocation.
Use kvfree(), as the index context cleanup already does, to handle both
allocation types.
Fixes: 0a8ac0c1fa0b ("ntfs: update directory operations")
Signed-off-by: Dandan Wu <wudandan@kylinos.cn>
---
fs/ntfs/index.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ntfs/index.c b/fs/ntfs/index.c
index b4462f760e3b..d565accb05d5 100644
--- a/fs/ntfs/index.c
+++ b/fs/ntfs/index.c
@@ -2274,7 +2274,7 @@ static struct index_entry *ntfs_index_walk_up(struct index_entry *ie,
ictx->pindex--;
if (!ictx->pindex) {
/* we have reached the root */
- kfree(ictx->ib);
+ kvfree(ictx->ib);
ictx->ib = NULL;
ictx->is_in_root = true;
/* a new search context is to be allocated */
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v1] ntfs: use kvfree when ascending an index tree
2026-11-20 9:20 [PATCH v1] ntfs: use kvfree when ascending an index tree Dandan Wu
@ 2026-11-20 9:27 ` liubaolin
0 siblings, 0 replies; 2+ messages in thread
From: liubaolin @ 2026-11-20 9:27 UTC (permalink / raw)
To: Dandan Wu, linkinjeon, hyc.lee; +Cc: ntfs, linux-kernel, Dandan Wu
在 2026/11/20 17:20, Dandan Wu 写道:
> From: Dandan Wu <wudandan@kylinos.cn>
>
> ntfs_index_walk_down() allocates the index block with kvzalloc(), which
> may return vmalloc memory. When traversal ascends back to the root,
> ntfs_index_walk_up() passes that block to kfree(), which cannot free a
> vmalloc allocation.
>
> Use kvfree(), as the index context cleanup already does, to handle both
> allocation types.
>
> Fixes: 0a8ac0c1fa0b ("ntfs: update directory operations")
> Signed-off-by: Dandan Wu <wudandan@kylinos.cn>
> ---
> fs/ntfs/index.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ntfs/index.c b/fs/ntfs/index.c
> index b4462f760e3b..d565accb05d5 100644
> --- a/fs/ntfs/index.c
> +++ b/fs/ntfs/index.c
> @@ -2274,7 +2274,7 @@ static struct index_entry *ntfs_index_walk_up(struct index_entry *ie,
> ictx->pindex--;
> if (!ictx->pindex) {
> /* we have reached the root */
> - kfree(ictx->ib);
> + kvfree(ictx->ib);
> ictx->ib = NULL;
> ictx->is_in_root = true;
> /* a new search context is to be allocated */
Looks good to me.
Reviewed-by: Baolin Liu <liubaolin@kylinos.cn>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-20 9:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-20 9:20 [PATCH v1] ntfs: use kvfree when ascending an index tree Dandan Wu
2026-11-20 9:27 ` liubaolin
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®