Skip to content

Commit 0d0f659

Browse files
Tetsuo Handaaalexandrovich
authored andcommitted
fs/ntfs3: Use __GFP_NOWARN allocation at wnd_init()
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]>
1 parent 557d196 commit 0d0f659

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
@@ -661,7 +661,7 @@ int wnd_init(struct wnd_bitmap *wnd, struct super_block *sb, size_t nbits)
661661
if (!wnd->bits_last)
662662
wnd->bits_last = wbits;
663663

664-
wnd->free_bits = kcalloc(wnd->nwnd, sizeof(u16), GFP_NOFS);
664+
wnd->free_bits = kcalloc(wnd->nwnd, sizeof(u16), GFP_NOFS | __GFP_NOWARN);
665665
if (!wnd->free_bits)
666666
return -ENOMEM;
667667

0 commit comments

Comments
 (0)