From: Christoph Hellwig <hch@infradead.org>
To: Barry Naujok <bnaujok@sgi.com>
Cc: "xfs@oss.sgi.com" <xfs@oss.sgi.com>
Subject: Re: REVIEW: Zero uninitialised xfs_da_args structure in xfs_dir2.c
Date: Mon, 2 Jun 2008 01:50:28 -0400 [thread overview]
Message-ID: <20080602055028.GA1629@infradead.org> (raw)
In-Reply-To: <op.ub3wttk53jf8g2@pc-bnaujok.melbourne.sgi.com>
On Mon, Jun 02, 2008 at 03:42:55PM +1000, Barry Naujok wrote:
> In particular, this patch fixes a problem in the xfs_dir2_remove and
> xfs_dir2_replace paths which internally can call a lookup function
> which will use args->cmpresult which is uninitialised.
> Index: 2.6.x-xfs/fs/xfs/xfs_dir2.c
> ===================================================================
> --- 2.6.x-xfs.orig/fs/xfs/xfs_dir2.c
> +++ 2.6.x-xfs/fs/xfs/xfs_dir2.c
> @@ -213,6 +213,7 @@ xfs_dir_createname(
> if ((rval = xfs_dir_ino_validate(tp->t_mountp, inum)))
> return rval;
> XFS_STATS_INC(xs_dir_create);
> + memset(&args, 0, sizeof(xfs_da_args_t));
>
> args.name = name->name;
> args.namelen = name->len;
Doing these memsets looks good. Stylisticly I'd rather put them
directly in front of the intialization for the actually used args
fields.
next prev parent reply other threads:[~2008-06-02 5:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-02 5:42 REVIEW: Zero uninitialised xfs_da_args structure in xfs_dir2.c Barry Naujok
2008-06-02 5:50 ` Christoph Hellwig [this message]
2008-06-02 6:08 ` Barry Naujok
2008-06-02 6:08 ` 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=20080602055028.GA1629@infradead.org \
--to=hch@infradead.org \
--cc=bnaujok@sgi.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox