* [PATCH] nfsd/nfs4acl: Number of used used array elements needs to be zeroed.
@ 2008-09-04 14:55 Jiri Pirko
[not found] ` <20080904165518.15a02908-YzwxZg+R7evSU73v1vjTzyO4YDw3rz4rAInAS/Ez/D0@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Jiri Pirko @ 2008-09-04 14:55 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-nfs, bfields, neilb
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;
}
--
1.5.5.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] nfsd/nfs4acl: Number of used used array elements needs to be zeroed.
2008-09-04 14:55 [PATCH] nfsd/nfs4acl: Number of used used array elements needs to be zeroed Jiri Pirko
@ 2008-09-04 15:01 ` J. Bruce Fields
0 siblings, 0 replies; 7+ messages in thread
From: J. Bruce Fields @ 2008-09-04 15:01 UTC (permalink / raw)
To: Jiri Pirko; +Cc: linux-kernel, linux-nfs, neilb
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] nfsd/nfs4acl: Number of used used array elements needs to be zeroed.
@ 2008-09-04 15:01 ` J. Bruce Fields
0 siblings, 0 replies; 7+ messages in thread
From: J. Bruce Fields @ 2008-09-04 15:01 UTC (permalink / raw)
To: Jiri Pirko; +Cc: linux-kernel, linux-nfs, neilb
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] nfsd/nfs4acl: Number of used used array elements needs to be zeroed.
2008-09-04 15:01 ` J. Bruce Fields
(?)
@ 2008-09-04 16:40 ` Benny Halevy
2008-09-04 16:47 ` david m. richter
2008-09-04 16:51 ` J. Bruce Fields
-1 siblings, 2 replies; 7+ messages in thread
From: Benny Halevy @ 2008-09-04 16:40 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: Jiri Pirko, linux-kernel, linux-nfs, neilb
On Sep. 04, 2008, 18:01 +0300, "J. Bruce Fields" <bfields@fieldses.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@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?
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;
Benny
>
> --b.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] nfsd/nfs4acl: Number of used used array elements needs to be zeroed.
2008-09-04 16:40 ` Benny Halevy
@ 2008-09-04 16:47 ` david m. richter
2008-09-04 16:51 ` J. Bruce Fields
1 sibling, 0 replies; 7+ messages in thread
From: david m. richter @ 2008-09-04 16:47 UTC (permalink / raw)
To: Benny Halevy; +Cc: J. Bruce Fields, Jiri Pirko, linux-kernel, linux-nfs, neilb
On Thu, 4 Sep 2008, Benny Halevy wrote:
> On Sep. 04, 2008, 18:01 +0300, "J. Bruce Fields" <bfields@fieldses.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@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?
>
> 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);
:) heheheh, we could've used your sharp eyes last week when we
were dealing with ACL shenanigans -- i believe that this is covered in one
of the patches that bruce sent out in the last few days.
d
.
> state->users = kzalloc(alloc, GFP_KERNEL);
> if (!state->users)
> return -ENOMEM;
>
> Benny
>
> >
> > --b.
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] nfsd/nfs4acl: Number of used used array elements needs to be zeroed.
2008-09-04 16:40 ` Benny Halevy
2008-09-04 16:47 ` david m. richter
@ 2008-09-04 16:51 ` J. Bruce Fields
1 sibling, 0 replies; 7+ messages in thread
From: J. Bruce Fields @ 2008-09-04 16:51 UTC (permalink / raw)
To: Benny Halevy; +Cc: Jiri Pirko, linux-kernel, linux-nfs, neilb
On Thu, Sep 04, 2008 at 07:40:48PM +0300, Benny Halevy wrote:
> On Sep. 04, 2008, 18:01 +0300, "J. Bruce Fields" <bfields@fieldses.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@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?
>
> 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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] nfsd/nfs4acl: Number of used used array elements needs to be zeroed.
2008-09-04 15:01 ` J. Bruce Fields
(?)
(?)
@ 2008-09-04 22:20 ` Jiri Pirko
-1 siblings, 0 replies; 7+ messages in thread
From: Jiri Pirko @ 2008-09-04 22:20 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: linux-kernel, linux-nfs, neilb
On Thu, 4 Sep 2008 11:01:01 -0400
"J. Bruce Fields" <bfields@fieldses.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@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?
Sure you are right. Sorry, my bad...
Jirka
>
> --b.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-09-04 22:20 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-04 14:55 [PATCH] nfsd/nfs4acl: Number of used used array elements needs to be zeroed Jiri Pirko
[not found] ` <20080904165518.15a02908-YzwxZg+R7evSU73v1vjTzyO4YDw3rz4rAInAS/Ez/D0@public.gmane.org>
2008-09-04 15:01 ` J. Bruce Fields
2008-09-04 15:01 ` J. Bruce Fields
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
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.