public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "B. N. Poornima" <poornima@in.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH]Fix potential Divide by Zero error in ext2_get_inode()
Date: Wed, 13 May 2009 15:04:25 -0700	[thread overview]
Message-ID: <20090513150425.89ac9b1c.akpm@linux-foundation.org> (raw)
In-Reply-To: <4A0A82ED.2040906@in.ibm.com>

On Wed, 13 May 2009 13:51:01 +0530
"B. N. Poornima" <poornima@in.ibm.com> wrote:

> Found a line of code in ext2_get_inode function of inode.c in the ext2 
> filesystem that has the potential of hitting the divide by 0 error.
> *************************************************
>  block_group = (ino - 1) / EXT2_INODES_PER_GROUP(sb);
> *************************************************
> There is no checking done here to verify if EXT2_INODES_PER_GROUP() 
> returns 0. This could result in divide by zero error and panic the system.
> Below is the patch, built against 2.6.30-rc5,  to correct the same:

EXT2_INODES_PER_GROUP() cannot return zero.  See ext2_fill_super():

	if (sbi->s_inodes_per_block == 0 || sbi->s_inodes_per_group == 0)
		goto cantfind_ext2;


  reply	other threads:[~2009-05-13 22:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13  8:21 [PATCH]Fix potential Divide by Zero error in ext2_get_inode() B. N. Poornima
2009-05-13 22:04 ` Andrew Morton [this message]
2009-05-14 11:37   ` B. N. Poornima

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=20090513150425.89ac9b1c.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=poornima@in.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox