diff options
author | Tetsuo Handa | 2022-10-02 23:54:11 +0900 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-01-04 11:28:57 +0100 |
commit | fd8aa71b65710ddbe3698892850d7e576fc23acb (patch) | |
tree | 3bbf0874fb411da3653c81600f9376e0f0f0e512 /fs/ntfs3/super.c | |
parent | 590a6943a1d12776f13dd96d0d02f86955da2343 (diff) |
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 <syzbot+33f3faaa0c08744f7d40@syzkaller.appspotmail.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/ntfs3/super.c')
-rw-r--r-- | fs/ntfs3/super.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index 94f9e4b775a7..8e2fe0f69203 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -1141,7 +1141,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; |