Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6c93fd1e578669364e026a0d44c669b871e2a8c4
Commit:     6c93fd1e578669364e026a0d44c669b871e2a8c4
Parent:     49686f71060e342bce6644a5c69fbc6ad0e75a13
Author:     Russell Cattelan <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 8 17:47:51 2007 -0600
Committer:  Steven Whitehouse <[EMAIL PROTECTED]>
CommitDate: Mon Feb 5 13:36:28 2007 -0500

    [GFS2] BZ 217008 fsfuzzer fix.
    
    Update the quilt header comments to match the
    code changes.
    
    Change gfs2_lookup_simple to return an error in the case
    of a NULL inode.
    The callers of gfs2_lookup_simple do not check for NULL
    in the no entry case and such would end up dereferencing a NULL ptr.
    
    This fixes:
    http://projects.info-pull.com/mokb/MOKB-15-11-2006.html
    
    Signed-off-by: Russell Cattelan <[EMAIL PROTECTED]>
    Signed-off-by: Steven Whitehouse <[EMAIL PROTECTED]>
---
 fs/gfs2/inode.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 6bc4436..bab338f 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -361,8 +361,18 @@ out:
 struct inode *gfs2_lookup_simple(struct inode *dip, const char *name)
 {
        struct qstr qstr;
+       struct inode *inode;
        gfs2_str2qstr(&qstr, name);
-       return gfs2_lookupi(dip, &qstr, 1, NULL);
+       inode = gfs2_lookupi(dip, &qstr, 1, NULL);
+       /* gfs2_lookupi has inconsistent callers: vfs
+        * related routines expect NULL for no entry found,
+        * gfs2_lookup_simple callers expect ENOENT
+        * and do not check for NULL.
+        */
+       if (inode == NULL)
+               return ERR_PTR(-ENOENT);
+       else
+               return inode;
 }
 
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to