From: "B. N. Poornima" <poornima@in.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH]Fix potential Divide by Zero error in ext2_get_inode()
Date: Thu, 14 May 2009 17:07:35 +0530 [thread overview]
Message-ID: <4A0C027F.8070806@in.ibm.com> (raw)
In-Reply-To: <20090513150425.89ac9b1c.akpm@linux-foundation.org>
Andrew Morton wrote:
> 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;
>
>
Andrew,
Thanks for pointing that out!
Regards,
Poornima.
prev parent reply other threads:[~2009-05-14 11:37 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
2009-05-14 11:37 ` B. N. Poornima [this message]
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=4A0C027F.8070806@in.ibm.com \
--to=poornima@in.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/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