linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell Cattelan <cattelan@thebarn.com>
To: linux-fsdevel@vger.kernel.org
Cc: Steven Whitehouse <swhiteho@redhat.com>
Subject: [PATCH] GFS2: Fix incorrect return code from gfs2_lookupi
Date: Thu, 04 Jan 2007 21:32:22 -0600	[thread overview]
Message-ID: <1167967942.12689.61.camel@xenon.msp.redhat.com> (raw)


[-- 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 --]

             reply	other threads:[~2007-01-05  4:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-05  3:32 Russell Cattelan [this message]
2007-01-05  9:21 ` [PATCH] GFS2: Fix incorrect return code from gfs2_lookupi Steven Whitehouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1167967942.12689.61.camel@xenon.msp.redhat.com \
    --to=cattelan@thebarn.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=swhiteho@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).