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

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=89dbb3a789a5b9711793Signed-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
...@@ -52,7 +52,7 @@ int ntfs_load_attr_list(struct ntfs_inode *ni, struct ATTRIB *attr) ...@@ -52,7 +52,7 @@ int ntfs_load_attr_list(struct ntfs_inode *ni, struct ATTRIB *attr)
if (!attr->non_res) { if (!attr->non_res) {
lsize = le32_to_cpu(attr->res.data_size); 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) { if (!le) {
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
...@@ -80,7 +80,7 @@ int ntfs_load_attr_list(struct ntfs_inode *ni, struct ATTRIB *attr) ...@@ -80,7 +80,7 @@ int ntfs_load_attr_list(struct ntfs_inode *ni, struct ATTRIB *attr)
if (err < 0) if (err < 0)
goto out; goto out;
le = kmalloc(al_aligned(lsize), GFP_NOFS); le = kmalloc(al_aligned(lsize), GFP_NOFS | __GFP_NOWARN);
if (!le) { if (!le) {
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment