All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thiemo Nagel <thiemo.nagel@ph.tum.de>
To: Theodore Tso <tytso@mit.edu>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] ext4: fix null pointer deref on mount
Date: Thu, 22 Jan 2009 01:43:16 +0100	[thread overview]
Message-ID: <4977C124.5030102@ph.tum.de> (raw)
In-Reply-To: <20090106041230.GA21733@mit.edu>

Dear Ted,

one (hopefully) last thing about this patch:

>  	blocks_count = (ext4_blocks_count(es) -
>  			le32_to_cpu(es->s_first_data_block) +
>  			EXT4_BLOCKS_PER_GROUP(sb) - 1);
>  	do_div(blocks_count, EXT4_BLOCKS_PER_GROUP(sb));
> +	if (blocks_count > ((uint64_t)1<<32) - EXT4_DESC_PER_BLOCK(sb)) {
> +		printk(KERN_WARNING "EXT4-fs: groups count too large: %u "
> +		       "(block count %llu, first data block %u, "
> +		       "blocks per group %lu)\n", sbi->s_groups_count,
> +		       ext4_blocks_count(es),
> +		       le32_to_cpu(es->s_first_data_block),
> +		       EXT4_BLOCKS_PER_GROUP(sb));
> +		goto failed_mount;
> +	}
>  	sbi->s_groups_count = blocks_count;
>  	db_count = (sbi->s_groups_count + EXT4_DESC_PER_BLOCK(sb) - 1) /
>  		   EXT4_DESC_PER_BLOCK(sb);

When you printk() sbi->s_groups_count it is not yet initialised, I think 
blocks_count should be used there instead.

Kind regards,

Thiemo

  reply	other threads:[~2009-01-21 23:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-05  1:19 [PATCH] ext4: fix null pointer deref on mount Thiemo Nagel
2009-01-05 17:02 ` Theodore Tso
2009-01-05 20:50   ` Thiemo Nagel
2009-01-05 21:39     ` Theodore Tso
2009-01-05 22:50       ` Thiemo Nagel
2009-01-05 23:34         ` Theodore Tso
2009-01-05 23:44         ` Theodore Tso
2009-01-06  4:12           ` Theodore Tso
2009-01-22  0:43             ` Thiemo Nagel [this message]
2009-01-06 12:46           ` Thiemo Nagel
2009-01-06 13:25             ` Theodore Tso
2009-01-06 16:32               ` Thiemo Nagel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4977C124.5030102@ph.tum.de \
    --to=thiemo.nagel@ph.tum.de \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.