Re: [PATCH 2/4] xfs: validate untrusted inode numbers during lookup

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

 



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?

> +	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.

> +#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.

> +	}
> +error0:

I'd just call it out, or replace the goto by and if/else

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


[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux