Re: [RFC PATCH 11/17] Fix overflow in calculation of total file system blocks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 13, 2008 at 01:04:02PM -0700, Andreas Dilger wrote:
> 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.

My approach with this kind of thing is to not make the reader try to
remember the exact type conversion rules, but I'll take it out if it's
just too much.

> This should really be part of patch 05/17 because that is where "real_end"
> is turned into a 64-bit value.

Okay, I'll fold it back.

-VAL
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux