[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <20081113200402.GW16005@webber.adilger.int>
Date: Thu, 13 Nov 2008 13:04:02 -0700
From: Andreas Dilger <adilger@....com>
To: Valerie Aurora Henson <vaurora@...hat.com>
Cc: linux-ext4@...r.kernel.org
Subject: Re: [RFC PATCH 11/17] Fix overflow in calculation of total file system
blocks
On Nov 11, 2008 19:43 -0800, Valerie Aurora Henson wrote:
> Blocks per group and group desc count are both 32-bit; multiplied they
> produce a 32-bit quantity which overflowed.
>
> @@ -92,8 +92,8 @@ errcode_t ext2fs_allocate_block_bitmap(ext2_filsys fs,
> - real_end = (EXT2_BLOCKS_PER_GROUP(fs->super)
> - * fs->group_desc_count)-1 + start;
> + real_end = ((__u64) EXT2_BLOCKS_PER_GROUP(fs->super)
> + * (__u64) fs->group_desc_count)-1 + start;
Casting the first value to __u64 should be enough.
This should really be part of patch 05/17 because that is where "real_end"
is turned into a 64-bit value.
There is a similar fix missing from ext2fs_allocate_inode_bitmap() (even
though there isn't any support for 64-bit inode numbers as yet.
Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists