Skip to content

Commit abd2ee2

Browse files
Tetsuo Handagregkh
authored andcommitted
fs/ntfs3: Use __GFP_NOWARN allocation at wnd_init()
[ Upstream commit 0d0f659 ] 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 <[email protected]> Signed-off-by: Tetsuo Handa <[email protected]> Signed-off-by: Konstantin Komarov <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent d7ce7bb commit abd2ee2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ntfs3/bitmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ int wnd_init(struct wnd_bitmap *wnd, struct super_block *sb, size_t nbits)
666666
if (!wnd->bits_last)
667667
wnd->bits_last = wbits;
668668

669-
wnd->free_bits = kcalloc(wnd->nwnd, sizeof(u16), GFP_NOFS);
669+
wnd->free_bits = kcalloc(wnd->nwnd, sizeof(u16), GFP_NOFS | __GFP_NOWARN);
670670
if (!wnd->free_bits)
671671
return -ENOMEM;
672672

0 commit comments

Comments
 (0)