[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080819091339.GE14799@duck.suse.cz>
Date: Tue, 19 Aug 2008 11:13:39 +0200
From: Jan Kara <jack@...e.cz>
To: Andreas Dilger <adilger@....com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
Sami Liedes <sliedes@...hut.fi>,
Andrew Morton <akpm@...ux-foundation.org>,
bugme-daemon@...zilla.kernel.org, linux-ext4@...r.kernel.org
Subject: Re: [Bugme-new] [Bug 11266] New: unable to handle kernel paging
request in ext2_free_blocks
On Mon 18-08-08 21:24:10, Andreas Dilger wrote:
> On Aug 18, 2008 22:21 +0530, Aneesh Kumar wrote:
> > > +static int ext2_block_in_group(struct super_block *sb,
> > > + unsigned int block_group, ext2_fsblk_t block)
> > > +{
> > > + if (block < ext2_group_first_block_no(sb, block_group))
> > > + return 0;
> > > + if (block >= ext2_group_first_block_no(sb, block_group) +
> > > + EXT2_BLOCKS_PER_GROUP(sb))
> > > + return 0;
> > > + return 1;
> > > +}
> > > +
> > > /*
> > > * Read the bitmap for a given block_group,and validate the
> > > * bits for block/inode/inode tables are set in the bitmaps
> > > @@ -129,6 +140,24 @@ read_block_bitmap(struct super_block *sb, unsigned int block_group)
> > > desc = ext2_get_group_desc(sb, block_group, NULL);
> > > if (!desc)
> > > return NULL;
> > > + if (!ext2_block_in_group(sb, block_group,
> > > + le32_to_cpu(desc->bg_block_bitmap)) ||
> > > + !ext2_block_in_group(sb, block_group,
> > > + le32_to_cpu(desc->bg_inode_bitmap)) ||
> > > + !ext2_block_in_group(sb, block_group,
> > > + le32_to_cpu(desc->bg_inode_table)) ||
> > > + !ext2_block_in_group(sb, block_group,
> > > + le32_to_cpu(desc->bg_inode_table) +
> > > + EXT2_SB(sb)->s_itb_per_group - 1)) {
>
> Isn't equivalent checking done in ext2_check_descriptors()? It would make
> sense to abstract out the "check one group and return error" code and use
> it in both places.
Actually yes, it is. Good point. Sami, is it the case that you have
mounted the filesystem, then intentionally corrupted it and after that
the kernel oopsed (as opposed to first corrupting the filesystem image and
mounting it after that)? That would explain how corrupted values could get
to read_block_bitmap() even though ext2_check_descriptors() checked them.
Honza
--
Jan Kara <jack@...e.cz>
SUSE Labs, CR
--
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