diff options
author | Theodore Ts'o <tytso@mit.edu> | 2010-05-14 18:03:14 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-05-14 18:06:40 -0400 |
commit | e6238d3708d328851bfdff7580d1b8504c7cf2e4 (patch) | |
tree | f053bbe1ad7b9d087bb10a28a2f261ae0f717b0d /e2fsck | |
parent | ee74cf16b5aa98fc210da23ba3a6c64d5a63289d (diff) | |
download | e2fsprogs-e6238d3708d328851bfdff7580d1b8504c7cf2e4.tar.gz |
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 <jiayingz@google.com> for finding this bug.
Addresses-Google-Bug: #2573806
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'e2fsck')
-rw-r--r-- | e2fsck/pass1.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 5e2ecc7a..c35937f5 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) |