Whamcloud - gitweb
libext2fs: check for invalid blocks in ext2fs_punch_blocks()
authorTheodore Ts'o <tytso@mit.edu>
Tue, 7 Jun 2022 03:48:37 +0000 (23:48 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 7 Jun 2022 04:22:18 +0000 (00:22 -0400)
commit6772d4969e9c90460945bbf02b87c227b93a9832
treee1a99cf717733c78c9bf5267e674f3da40dd0375
parent2d30ab20ae4eda6660ead5c79367e91e85322233
libext2fs: check for invalid blocks in ext2fs_punch_blocks()

If the extent tree has out-of-range physical block numbers, don't try
to release them.

Also add a similar check in ext2fs_block_alloc_stats2() to avoid a
NULL pointer dereference.

Reported-by: Nils Bars <nils.bars@rub.de>
Reported-by: Moritz Schlögel <moritz.schloegel@rub.de>
Reported-by: Nico Schiller <nico.schiller@rub.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/alloc_stats.c
lib/ext2fs/punch.c