Skip to content

Commit ea303f7

Browse files
Tetsuo Handaaalexandrovich
authored andcommitted
fs/ntfs3: Use __GFP_NOWARN allocation at ntfs_load_attr_list()
syzbot is reporting too large allocation at ntfs_load_attr_list(), for a crafted filesystem can have huge data_size. Reported-by: syzbot <[email protected]> Link: https://syzkaller.appspot.com/bug?extid=89dbb3a789a5b9711793 Signed-off-by: Tetsuo Handa <[email protected]> Signed-off-by: Konstantin Komarov <[email protected]>
1 parent 97498cd commit ea303f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/ntfs3/attrlist.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ int ntfs_load_attr_list(struct ntfs_inode *ni, struct ATTRIB *attr)
5252

5353
if (!attr->non_res) {
5454
lsize = le32_to_cpu(attr->res.data_size);
55-
le = kmalloc(al_aligned(lsize), GFP_NOFS);
55+
le = kmalloc(al_aligned(lsize), GFP_NOFS | __GFP_NOWARN);
5656
if (!le) {
5757
err = -ENOMEM;
5858
goto out;
@@ -80,7 +80,7 @@ int ntfs_load_attr_list(struct ntfs_inode *ni, struct ATTRIB *attr)
8080
if (err < 0)
8181
goto out;
8282

83-
le = kmalloc(al_aligned(lsize), GFP_NOFS);
83+
le = kmalloc(al_aligned(lsize), GFP_NOFS | __GFP_NOWARN);
8484
if (!le) {
8585
err = -ENOMEM;
8686
goto out;

0 commit comments

Comments
 (0)