[PATCH] GFS2: Fix incorrect return code from gfs2_lookupi

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This fixes a bug found by the fsfuzzer tool.
http://projects.info-pull.com/mokb/MOKB-15-11-2006.html

A NULL was not an acceptable error condition expected
by any of the gfs2_lookupi callers.

-- 
Russell Cattelan <cattelan@xxxxxxx>
Change gfs2_lookupi to either return an inode or an error.
None of the callers of gfs2_lookupi expect a NULL on error
and such would end up dereferencing all NULL ptr.

This fixes:
http://projects.info-pull.com/mokb/MOKB-15-11-2006.html

Signed-off-by: Russell Cattelan <cattelan@xxxxxxx>
Index: gfs2_crap/fs/gfs2/inode.c
===================================================================
--- gfs2_crap.orig/fs/gfs2/inode.c	2007-01-04 19:40:39.000000000 -0600
+++ gfs2_crap/fs/gfs2/inode.c	2007-01-04 19:43:01.694217574 -0600
@@ -419,7 +419,7 @@ struct inode *gfs2_lookupi(struct inode 
 out:
 	gfs2_glock_dq_uninit(&d_gh);
 	if (error == -ENOENT)
-		return NULL;
+		return ERR_PTR(error);
 	return inode;
 }
 

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux