Whamcloud - gitweb
libext2fs: don't allow alloc_stats on bad inode/block numbers
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 17 Nov 2014 22:59:42 +0000 (17:59 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 17 Nov 2014 22:59:42 +0000 (17:59 -0500)
commitc9d6c22deda4b526dcf37159be7957c1c38b79e7
treee4b004c31deeb11e9a75e87008ddbb572070aa00
parent407916f5af4443e0ddd9469c57fc1684c07f9294
libext2fs: don't allow alloc_stats on bad inode/block numbers

Don't allow callers to feed bad block/inode numbers to
ext2fs_*_alloc_stats2, because evil callers (<cough>resize2fs<cough>)
can corrupt library state this way, leading to a crash.

(There will be a subsequent patch to resize2fs to fix its bad
behavior.)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/alloc_stats.c