From: Tetsuo Handa Date: Sun, 2 Oct 2022 14:54:11 +0000 (+0900) Subject: fs/ntfs3: Use __GFP_NOWARN allocation at ntfs_fill_super() X-Git-Tag: v5.15.92~707 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9847a11b683784d78893a8c8c07e5ceeda8b1c6;p=platform%2Fkernel%2Flinux-rpi.git fs/ntfs3: Use __GFP_NOWARN allocation at ntfs_fill_super() [ Upstream commit 59bfd7a483da36bd202532a3d9ea1f14f3bf3aaf ] syzbot is reporting too large allocation at ntfs_fill_super() [1], for a crafted filesystem can contain bogus inode->i_size. Add __GFP_NOWARN in order to avoid too large allocation warning, than exhausting memory by using kvmalloc(). Link: https://syzkaller.appspot.com/bug?extid=33f3faaa0c08744f7d40 [1] Reported-by: syzot Signed-off-by: Tetsuo Handa Signed-off-by: Konstantin Komarov Signed-off-by: Sasha Levin --- diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index a18fb43..33b1833 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -1136,7 +1136,7 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc) goto put_inode_out; } bytes = inode->i_size; - sbi->def_table = t = kmalloc(bytes, GFP_NOFS); + sbi->def_table = t = kmalloc(bytes, GFP_NOFS | __GFP_NOWARN); if (!t) { err = -ENOMEM; goto put_inode_out;