Whamcloud - gitweb
libext2fs: fix the {set_get}_bitmap_range functions when bitmap->start > 7
authorTheodore Ts'o <tytso@mit.edu>
Fri, 20 Mar 2020 19:24:18 +0000 (15:24 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 20 Mar 2020 19:24:18 +0000 (15:24 -0400)
commit23c6ef3de362aa291a15cc21a8a82a534a785fde
tree340f3d1234bcebee76396098f197dc6fdf41a715
parent125850eb92f042c76b6f001bf63833ffc15e7916
libext2fs: fix the {set_get}_bitmap_range functions when bitmap->start > 7

The bitmap array's set/get bitmap_range functions were not subtracting
out bitmap->start.  This doesn't matter for normal file systems, since
the bitmap->start is zero or one, and the passed-in starting range is
a multiple of eight, and the starting range is then divided by 8.

But with a non-standard/fuzzed file system, bitmap->start could be
significantly larger, and this could then lead to a array out of
bounds memory reference.

Google-Bug-Id: 147849134
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/gen_bitmap.c