linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] GFS2: Fix incorrect return code from gfs2_lookupi
@ 2007-01-05  3:32 Russell Cattelan
  2007-01-05  9:21 ` Steven Whitehouse
  0 siblings, 1 reply; 2+ messages in thread
From: Russell Cattelan @ 2007-01-05  3:32 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Steven Whitehouse


[-- Attachment #1.1: Type: text/plain, Size: 241 bytes --]

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@xfs.org>

[-- Attachment #1.2: fuzzer_fix --]
[-- Type: text/plain, Size: 733 bytes --]

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@xfs.org>
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 #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] GFS2: Fix incorrect return code from gfs2_lookupi
  2007-01-05  3:32 [PATCH] GFS2: Fix incorrect return code from gfs2_lookupi Russell Cattelan
@ 2007-01-05  9:21 ` Steven Whitehouse
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2007-01-05  9:21 UTC (permalink / raw)
  To: Russell Cattelan; +Cc: linux-fsdevel

Hi,

On Thu, 2007-01-04 at 21:32 -0600, Russell Cattelan wrote:
> 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.
> 

Now applied to the GFS2 git tree. Thanks,

Steve.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-01-05  9:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-05  3:32 [PATCH] GFS2: Fix incorrect return code from gfs2_lookupi Russell Cattelan
2007-01-05  9:21 ` Steven Whitehouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).