linux-stable/fs/bfs
Tetsuo Handa ecfcb85cd6 bfs: add sanity check at bfs_fill_super()
commit 9f2df09a33 upstream.

syzbot is reporting too large memory allocation at bfs_fill_super() [1].
Since file system image is corrupted such that bfs_sb->s_start == 0,
bfs_fill_super() is trying to allocate 8MB of continuous memory. Fix
this by adding a sanity check on bfs_sb->s_start, __GFP_NOWARN and
printf().

[1] https://syzkaller.appspot.com/bug?id=16a87c236b951351374a84c8a32f40edbc034e96

Link: http://lkml.kernel.org/r/1525862104-3407-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reported-by: syzbot <syzbot+71c6b5d68e91149fc8a4@syzkaller.appspotmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Tigran Aivazian <aivazian.tigran@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-01 09:44:19 +01:00
..
Kconfig fs/bfs: remove depends on CONFIG_EXPERIMENTAL 2013-01-21 14:39:04 -08:00
Makefile
bfs.h fs/bfs: use bfs prefix for dump_imap 2014-08-08 15:57:24 -07:00
dir.c Merge remote-tracking branch 'ovl/rename2' into for-linus 2016-10-10 23:02:51 -04:00
file.c make new_sync_{read,write}() static 2015-04-11 22:29:40 -04:00
inode.c bfs: add sanity check at bfs_fill_super() 2018-12-01 09:44:19 +01:00