Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit c556e72

Browse files
Diogo Jahchan Koikegregkh
authored andcommitted
ntfs3: Change to non-blocking allocation in ntfs_d_hash
[ Upstream commit 589996b ] d_hash is done while under "rcu-walk" and should not sleep. __get_name() allocates using GFP_KERNEL, having the possibility to sleep when under memory pressure. Change the allocation to GFP_NOWAIT. Reported-by: [email protected] Closes: https://syzkaller.appspot.com/bug?extid=7f71f79bbfb4427b00e1 Fixes: d392e85 ("fs/ntfs3: Fix the format of the "nocase" mount option") Signed-off-by: Diogo Jahchan Koike <[email protected]> Signed-off-by: Konstantin Komarov <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent fd94986 commit c556e72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/ntfs3/namei.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ static int ntfs_d_hash(const struct dentry *dentry, struct qstr *name)
501501
/*
502502
* Try slow way with current upcase table
503503
*/
504-
uni = __getname();
504+
uni = kmem_cache_alloc(names_cachep, GFP_NOWAIT);
505505
if (!uni)
506506
return -ENOMEM;
507507

@@ -523,7 +523,7 @@ static int ntfs_d_hash(const struct dentry *dentry, struct qstr *name)
523523
err = 0;
524524

525525
out:
526-
__putname(uni);
526+
kmem_cache_free(names_cachep, uni);
527527
return err;
528528
}
529529

0 commit comments

Comments
 (0)