aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2013-09-16 09:41:15 -0400
committerTheodore Ts'o <tytso@mit.edu>2013-09-16 09:41:15 -0400
commit2db19bce8146a63b1cef19fe4628014c7f7de816 (patch)
tree5cedaf72744a8adf81176af6f758eb9769f1cde4
parentfc9f162eea8ade980b6347a70a020d43ba215540 (diff)
downloade2fsprogs-2db19bce8146a63b1cef19fe4628014c7f7de816.tar.gz
e2fsprogs-2db19bce8146a63b1cef19fe4628014c7f7de816.tar.xz
e2fsprogs-2db19bce8146a63b1cef19fe4628014c7f7de816.zip
e2fsck: fix incorrect bbitmap checksum failure caused by integer overflow
On a filesystem with more than 2^32 blocks, the block group checksum test will fail because "i" (the group number) is a 32-bit quantity that is used to calculate the group's block bitmap block number. Unfortunately, "i" is not automatically promoted to 64-bit for this calculation and overflows. When this happens, e2fsck will incorrectly report bitmap checksum errors. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--e2fsck/pass5.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/e2fsck/pass5.c b/e2fsck/pass5.c
index 51e4683d..346c8319 100644
--- a/e2fsck/pass5.c
+++ b/e2fsck/pass5.c
@@ -168,7 +168,7 @@ static void check_block_bitmap_checksum(e2fsck_t ctx)
blk_itr = EXT2FS_B2C(ctx->fs,
ctx->fs->super->s_first_data_block) +
- (i * (nbytes << 3));
+ ((blk64_t) i * (nbytes << 3));
retval = ext2fs_get_block_bitmap_range2(ctx->fs->block_map,
blk_itr, nbytes << 3,
buf);