aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorRussell Cattelan <cattelan@redhat.com>2007-01-08 18:47:51 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2007-02-05 13:36:28 -0500
commit6c93fd1e578669364e026a0d44c669b871e2a8c4 (patch)
tree282fd8a70fd4791a80a06dbddac1060cbc4f3848 /fs/gfs2/inode.c
parent49686f71060e342bce6644a5c69fbc6ad0e75a13 (diff)
[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 <cattelan@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 6bc443644c3c..bab338f6b610 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -361,8 +361,18 @@ out:
361struct inode *gfs2_lookup_simple(struct inode *dip, const char *name) 361struct inode *gfs2_lookup_simple(struct inode *dip, const char *name)
362{ 362{
363 struct qstr qstr; 363 struct qstr qstr;
364 struct inode *inode;
364 gfs2_str2qstr(&qstr, name); 365 gfs2_str2qstr(&qstr, name);
365 return gfs2_lookupi(dip, &qstr, 1, NULL); 366 inode = gfs2_lookupi(dip, &qstr, 1, NULL);
367 /* gfs2_lookupi has inconsistent callers: vfs
368 * related routines expect NULL for no entry found,
369 * gfs2_lookup_simple callers expect ENOENT
370 * and do not check for NULL.
371 */
372 if (inode == NULL)
373 return ERR_PTR(-ENOENT);
374 else
375 return inode;
366} 376}
367 377
368 378