]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: make sanity check in mballoc more strict
authorJan Kara <jack@suse.cz>
Sat, 6 Apr 2019 22:33:06 +0000 (18:33 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 6 Apr 2019 22:33:06 +0000 (18:33 -0400)
commit12ce1af19d00827184c44aad27c2196594cb3ae4
tree765666fd6d389929f1b6c7da4593d0b064562414
parentd4c191c72eb5803fecbeae38fc76436cfd433e33
ext4: make sanity check in mballoc more strict

The sanity check in mb_find_extent() only checked that returned extent
does not extend past blocksize * 8, however it should not extend past
EXT4_CLUSTERS_PER_GROUP(sb). This can happen when clusters_per_group <
blocksize * 8 and the tail of the bitmap is not properly filled by 1s
which happened e.g. when ancient kernels have grown the filesystem.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
fs/ext4/mballoc.c