From: Theodore Ts'o Date: Fri, 14 May 2010 22:03:14 +0000 (-0400) Subject: e2fsck: Explicitly reject extents that begin at physical block 0 as illegal X-Git-Tag: v1.41.12~12 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=e6238d3708d328851bfdff7580d1b8504c7cf2e4;p=tools%2Fe2fsprogs.git e2fsck: Explicitly reject extents that begin at physical block 0 as illegal 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 for finding this bug. Addresses-Google-Bug: #2573806 Signed-off-by: "Theodore Ts'o" --- diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 5e2ecc7..c35937f 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -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)