lkml.org 
[lkml]   [2009]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH]Fix potential Divide by Zero error in ext2_get_inode()
    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.


    \
     
     \ /
      Last update: 2009-05-14 13:41    [W:0.146 / U:0.008 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site