]> git.ipfire.org Git - people/ms/linux.git/blobdiff - fs/ext4/extents.c
Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git...
[people/ms/linux.git] / fs / ext4 / extents.c
index c148bb97b527359bf854428f659d7da87584009a..5235974126bd351839a87583c5741bfcc3d7d32f 100644 (file)
@@ -460,6 +460,10 @@ static int __ext4_ext_check(const char *function, unsigned int line,
                error_msg = "invalid eh_entries";
                goto corrupted;
        }
+       if (unlikely((eh->eh_entries == 0) && (depth > 0))) {
+               error_msg = "eh_entries is 0 but eh_depth is > 0";
+               goto corrupted;
+       }
        if (!ext4_valid_extent_entries(inode, eh, lblk, &pblk, depth)) {
                error_msg = "invalid extent entries";
                goto corrupted;