lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080904165126.GF4536@fieldses.org>
Date:	Thu, 4 Sep 2008 12:51:26 -0400
From:	"J. Bruce Fields" <bfields@...ldses.org>
To:	Benny Halevy <bhalevy@...asas.com>
Cc:	Jiri Pirko <jpirko@...hat.com>, linux-kernel@...r.kernel.org,
	linux-nfs@...r.kernel.org, neilb@...e.de
Subject: Re: [PATCH] nfsd/nfs4acl: Number of used used array elements needs
	to be zeroed.

On Thu, Sep 04, 2008 at 07:40:48PM +0300, Benny Halevy wrote:
> On Sep. 04, 2008, 18:01 +0300, "J. Bruce Fields" <bfields@...ldses.org> wrote:
> > 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@...hat.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?
> 
> quickly browsing over the code, shouldn't it be:
> 
> diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
> index b6ed383..54b8b41 100644
> --- a/fs/nfsd/nfs4acl.c
> +++ b/fs/nfsd/nfs4acl.c
> @@ -443,7 +443,7 @@ init_state(struct posix_acl_state *state, int cnt)
>  	 * enough space for either:
>  	 */
>  	alloc = sizeof(struct posix_ace_state_array)
> -		+ cnt*sizeof(struct posix_ace_state);
> +		+ cnt*sizeof(struct posix_user_ace_state);
>  	state->users = kzalloc(alloc, GFP_KERNEL);
>  	if (!state->users)
>  		return -ENOMEM;

Yep, see 91b80969ba466ba4b915a4a1d03add8c297add3f.--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ