diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 2f258c68d3e021..d7ccb7f51dfca6 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -478,6 +478,10 @@ static int __ext4_ext_check(const char *function, unsigned int line, error_msg = "invalid extent entries"; goto corrupted; } + if (unlikely(depth > 32)) { + error_msg = "too large eh_depth"; + goto corrupted; + } /* Verify checksum on non-root extent tree nodes */ if (ext_depth(inode) != depth && !ext4_extent_block_csum_verify(inode, eh)) {