From e6238d3708d328851bfdff7580d1b8504c7cf2e4 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 14 May 2010 18:03:14 -0400 Subject: [PATCH] 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" --- e2fsck/pass1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 1.8.3.1