]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 May 2019 05:37:42 +0000 (07:37 +0200)
commit71478ef67d7c39ba735c07ce3e39eae21ad8681a
tree7423f98bee1944ff321aa8e29acc03fb149a6622
parent001fe0dab4eacd9e714b7c9de5f13af2bb3c3e1a
ext4: make sanity check in mballoc more strict

commit 31562b954b60f02acb91b7349dc6432d3f8c3c5f upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/mballoc.c