Whamcloud - gitweb
e2fsck: avoid out-of-bounds write for very deep extent trees
authorTheodore Ts'o <tytso@mit.edu>
Tue, 7 Jun 2022 02:44:35 +0000 (22:44 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 7 Jun 2022 04:00:12 +0000 (00:00 -0400)
commit8d66e7e9316002ca9f9d558069bd56ccba9cece8
tree25ad74b20221cbfa3d9af09d68cbda228d318e61
parentf0c405f8b7bdabaf07284f1b52ba42b551152229
e2fsck: avoid out-of-bounds write for very deep extent trees

The kernel doesn't support extent trees deeper than 5
(EXT4_MAX_EXTENT_DEPTH).  For this reason we only maintain the extent
tree statistics for 5 levels.  Avoid out-of-bounds writes and reads if
the extent tree is deeper than this.

We keep these statistics to determine whether we should rebuild the
extent tree.  If the extent tree is too deep, we don't need the
statistics because we should always rebuild the it.

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>
e2fsck/extents.c
e2fsck/pass1.c