mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Jiri Pirko <jpirko@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, neilb@suse.de
Subject: Re: [PATCH] nfsd/nfs4acl: Number of used used array elements needs to be zeroed.
Date: Thu, 4 Sep 2008 11:01:01 -0400	[thread overview]
Message-ID: <20080904150101.GB4536@fieldses.org> (raw)
In-Reply-To: <20080904165518.15a02908@psychotron.englab.brq.redhat.com>

On Thu, Sep 04, 2008 at 04:55:18PM +0200, Jiri Pirko wrote:
> Number of used used array elements needs to be zeroed. It may cause
> problems otherwise, because it's used uninitialized in find_uid().
> 
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
> ---
>  fs/nfsd/nfs4acl.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
> index 54b8b41..7dcd90f 100644
> --- a/fs/nfsd/nfs4acl.c
> +++ b/fs/nfsd/nfs4acl.c
> @@ -447,11 +447,13 @@ init_state(struct posix_acl_state *state, int cnt)
>  	state->users = kzalloc(alloc, GFP_KERNEL);
>  	if (!state->users)
>  		return -ENOMEM;
> +	state->users->n = 0;
>  	state->groups = kzalloc(alloc, GFP_KERNEL);
>  	if (!state->groups) {
>  		kfree(state->users);
>  		return -ENOMEM;
>  	}
> +	state->groups->n = 0;
>  	return 0;
>  }

Thanks for the extra eyes on this code, but: surely the kzalloc()'s are
all that's necessary?  Am I missing something?

--b.

  reply	other threads:[~2008-09-04 15:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-04 14:55 Jiri Pirko
2008-09-04 15:01 ` J. Bruce Fields [this message]
2008-09-04 16:40   ` Benny Halevy
2008-09-04 16:47     ` david m. richter
2008-09-04 16:51     ` J. Bruce Fields
2008-09-04 22:20   ` Jiri Pirko

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=20080904150101.GB4536@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=jpirko@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    /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

all inboxes | Powered by JetHome®