ext4: check for out-of-order index extents in ext4_valid_extent_entries()
authorZhang Yi <yi.zhang@huawei.com>
Wed, 8 Sep 2021 12:08:48 +0000 (20:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Dec 2021 11:28:37 +0000 (12:28 +0100)
commitf71ab21b1a281d7f0769c1ca608241c2659ae3f8
tree1da7eef0f5e857e1d78c5cf8de512f16ec5c6f3b
parent02f825cf0255b9d9858acfe57c5ac29e2bc3eff8
ext4: check for out-of-order index extents in ext4_valid_extent_entries()

commit 8dd27fecede55e8a4e67eef2878040ecad0f0d33 upstream.

After commit 5946d089379a ("ext4: check for overlapping extents in
ext4_valid_extent_entries()"), we can check out the overlapping extent
entry in leaf extent blocks. But the out-of-order extent entry in index
extent blocks could also trigger bad things if the filesystem is
inconsistent. So this patch add a check to figure out the out-of-order
index extents and return error.

Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Link: https://lore.kernel.org/r/20210908120850.4012324-2-yi.zhang@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/extents.c