]> git.proxmox.com Git - mirror_ubuntu-disco-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)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 30 Jul 2019 10:58:17 +0000 (12:58 +0200)
commit3ac398161268e77d80f1f40934ab15c293aeac08
treee6530758324c6422d387bc306842d818e897992c
parentea7cb504e8fa6c974bbd6e37b57047dbb7a28c08
ext4: make sanity check in mballoc more strict

BugLink: https://bugs.launchpad.net/bugs/1836614
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>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
fs/ext4/mballoc.c