The branch stable/12 has been updated by nc (ports committer):

URL: 
https://cgit.FreeBSD.org/src/commit/?id=8facf7082d4973aedc30cdd8e90fbd33beb17d7f

commit 8facf7082d4973aedc30cdd8e90fbd33beb17d7f
Author:     Neel Chauhan <n...@freebsd.org>
AuthorDate: 2021-11-17 00:25:04 +0000
Commit:     Neel Chauhan <n...@freebsd.org>
CommitDate: 2021-11-29 17:57:12 +0000

    ext2fs: check for eh_depth in ext4_ext_check_header()
    
    PR:                     259112
    Reported by:            Robert Morris <r...@lcs.mit.edu>
    Reviewed by:            fsu (src)
    Differential Revision:  https://reviews.freebsd.org/D33030
    
    (cherry picked from commit be60d8f276fa20fc11ad814e54c9c2540f79c7da)
---
 sys/fs/ext2fs/ext2_extents.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/fs/ext2fs/ext2_extents.c b/sys/fs/ext2fs/ext2_extents.c
index 61c751e9af5e..ba95b8a6f3ae 100644
--- a/sys/fs/ext2fs/ext2_extents.c
+++ b/sys/fs/ext2fs/ext2_extents.c
@@ -250,6 +250,10 @@ ext4_ext_check_header(struct inode *ip, struct 
ext4_extent_header *eh)
                error_msg = "header: invalid eh_entries";
                goto corrupted;
        }
+       if (eh->eh_depth > 5) {
+               error_msg = "header: invalid eh_depth";
+               goto corrupted;
+       }
 
        return (0);
 

Reply via email to