mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
fs/ntfs3: Use __GFP_NOWARN allocation at wnd_init()
[ Upstream commit 0d0f659bf7 ]
syzbot is reporting too large allocation at wnd_init() [1], for a crafted
filesystem can become wnd->nwnd close to UINT_MAX. Add __GFP_NOWARN in
order to avoid too large allocation warning, than exhausting memory by
using kvcalloc().
Link: https://syzkaller.appspot.com/bug?extid=fa4648a5446460b7b963 [1]
Reported-by: syzot <syzbot+fa4648a5446460b7b963@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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d7ce7bb688
commit
abd2ee2cf4
@@ -666,7 +666,7 @@ int wnd_init(struct wnd_bitmap *wnd, struct super_block *sb, size_t nbits)
|
||||
if (!wnd->bits_last)
|
||||
wnd->bits_last = wbits;
|
||||
|
||||
wnd->free_bits = kcalloc(wnd->nwnd, sizeof(u16), GFP_NOFS);
|
||||
wnd->free_bits = kcalloc(wnd->nwnd, sizeof(u16), GFP_NOFS | __GFP_NOWARN);
|
||||
if (!wnd->free_bits)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user