All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: security@kernel.org, xfs@oss.sgi.com
Subject: Re: [PATCH 2/4] xfs: validate untrusted inode numbers during lookup
Date: Sat, 19 Jun 2010 10:07:07 +1000	[thread overview]
Message-ID: <20100619000707.GH6590@dastard> (raw)
In-Reply-To: <20100618114156.GA5417@infradead.org>

On Fri, Jun 18, 2010 at 07:41:56AM -0400, Christoph Hellwig wrote:
> On Fri, Jun 18, 2010 at 05:32:52PM +1000, Dave Chinner wrote:
> > +static int
> > +xfs_imap_lookup(
> 
> STATIC to keep the gcc inliner from overdoing thing?

*Nod*.

> 
> > +	xfs_mount_t	*mp,
> > +	xfs_trans_t	*tp,
> 
> > +{
> > +	xfs_inobt_rec_incore_t rec;
> > +	xfs_btree_cur_t	*cur;
> > +	xfs_buf_t	*agbp;
> 
> Please use the struct versions of these instead of the typedefs.

Copy-n-paste error - my bad.

> > +#ifdef DEBUG
> > +		xfs_fs_cmn_err(CE_ALERT, mp, "xfs_imap: "
> > +				"xfs_inobt_get_rec() failed");
> > +#endif /* DEBUG */
> > +		error = XFS_ERROR(EINVAL);
> 
> No need to print these even for debug kernels I think.  And even then
> we shouldn't do it if the untrusted flag is set.

Ok, I killed all the prints - they don't tell us what inode number
the error occurred on anyway, so they aren't very useful anyway....

> > +	}
> > +error0:
> 
> I'd just call it out, or replace the goto by and if/else

Ok, I rearranged the code to kill the goto. I will repost
the series after a QA run.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2010-06-19  0:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-18  7:32 xfs: validate inode numbers in file handles correctly Dave Chinner
2010-06-18  7:32 ` [PATCH 1/4] xfs: always use iget in bulkstat Dave Chinner
2010-06-18  7:32 ` [PATCH 2/4] xfs: validate untrusted inode numbers during lookup Dave Chinner
2010-06-18 11:41   ` Christoph Hellwig
2010-06-19  0:07     ` Dave Chinner [this message]
2010-06-18  7:32 ` [PATCH 3/4] xfs: rename XFS_IGET_BULKSTAT to XFS_IGET_UNTRUSTED Dave Chinner
2010-06-18 11:42   ` Christoph Hellwig
2010-06-18  7:32 ` [PATCH 4/4] xfs: remove block number from inode lookup code Dave Chinner
2010-06-18  8:22   ` Christoph Hellwig
2011-11-23 13:04 ` xfs: validate inode numbers in file handles correctly Guoquan Yang
2011-11-23 14:30   ` Christoph Hellwig
     [not found]     ` <SNT135-W7F5C64C2A3F67B48EFF3AA4CE0@phx.gbl>
2011-11-24 12:52       ` Christoph Hellwig
2011-11-28 11:19     ` Christoph Hellwig
2011-12-03  8:27       ` hank peng
2011-12-06 15:17         ` Christoph Hellwig
2011-12-03  9:56       ` yangguoquan
2011-12-29  9:19         ` xfs: validate inode numbers in file handles correctly--NFS Stale File Handle Again yangguoquan
2012-01-02 15:02           ` Christoph Hellwig
2012-01-04  2:20             ` yangguoquan
2012-01-24 17:58               ` Christoph Hellwig
2012-02-01  5:46                 ` yangguoquan
  -- strict thread matches above, loose matches on Subject: below --
2010-06-20 23:58 [PATCH 0/4, V2] xfs: validate inode numbers in file handles correctly Dave Chinner
2010-06-20 23:58 ` [PATCH 2/4] xfs: validate untrusted inode numbers during lookup Dave Chinner
2010-06-21  7:21   ` Christoph Hellwig

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=20100619000707.GH6590@dastard \
    --to=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=security@kernel.org \
    --cc=xfs@oss.sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.