]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
e2fsck: Explicitly reject extents that begin at physical block 0 as illegal
authorTheodore Ts'o <tytso@mit.edu>
Fri, 14 May 2010 22:03:14 +0000 (18:03 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 14 May 2010 22:06:40 +0000 (18:06 -0400)
In the case where s_first_data_block is 1, we need to explictly reject
an extent whose starting physical block is zero.

Thanks to Jiaying Zhang <jiayingz@google.com> for finding this bug.

Addresses-Google-Bug: #2573806

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/pass1.c

index 5e2ecc7ad07e50e1ffda3533ed2c5074b67dcaff..c35937f5be3257ef139676778f7acb66901b771d 100644 (file)
@@ -1694,7 +1694,8 @@ static void scan_extent_node(e2fsck_t ctx, struct problem_context *pctx,
                is_dir = LINUX_S_ISDIR(pctx->inode->i_mode);
 
                problem = 0;
-               if (extent.e_pblk < ctx->fs->super->s_first_data_block ||
+               if (extent.e_pblk == 0 ||
+                   extent.e_pblk < ctx->fs->super->s_first_data_block ||
                    extent.e_pblk >= ctx->fs->super->s_blocks_count)
                        problem = PR_1_EXTENT_BAD_START_BLK;
                else if (extent.e_lblk < start_block)