[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4963529F.4040703@ph.tum.de>
Date: Tue, 06 Jan 2009 13:46:23 +0100
From: Thiemo Nagel <thiemo.nagel@...tum.de>
To: Theodore Tso <tytso@....edu>
CC: Ext4 Developers List <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH] ext4: fix null pointer deref on mount
Theodore Tso wrote:
> I'd rewrite the test as:
> /*
> * It makes no sense for the first data block to be beyond the end
> * of the filesystem.
> */
> if (le32_to_cpu(es->s_first_data_block) >= ext4_blocks_count(es)) {
> printk(KERN_WARNING "EXT4-fs: bad geometry: first data"
> "block %u is beyond end of filesystem(%llu)\n",
> le32_to_cpu(es->s_first_data_block),
> ext4_blocks_count(es));
Much better.
>> @@ -2160,6 +2162,15 @@
>> EXT4_BLOCKS_PER_GROUP(sb) - 1);
>> do_div(blocks_count, EXT4_BLOCKS_PER_GROUP(sb));
>> sbi->s_groups_count = blocks_count;
>> + if (sbi->s_groups_count > ((uint64_t)1<<32) - EXT4_DESC_PER_BLOCK(sb)) {
>
> This can't possibly work, given that s_groups_count is an unsigned
> int.
I'm casting to uint64_t, so in my opinion it should work on all
architectures.
Kind regards,
Thiemo
--
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