Unverified Commit ea303f72 authored by Tetsuo Handa's avatar Tetsuo Handa Committed by Konstantin Komarov
Browse files

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: default avatarsyzbot <syzbot+89dbb3a789a5b9711793@syzkaller.appspotmail.com>
Link: https://syzkaller.appspot.com/bug?extid=89dbb3a789a5b9711793


Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
parent 97498cd6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ int ntfs_load_attr_list(struct ntfs_inode *ni, struct ATTRIB *attr)

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

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