Skip to content

Commit

Permalink
nfsd4: fix corruption on setting an ACL.
Browse files Browse the repository at this point in the history
As of 06f9cc1 "nfsd4: don't create
unnecessary mask acl", any non-trivial ACL will be left with an
unitialized entry, and a trivial ACL may write one entry beyond what's
allocated.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
J. Bruce Fields committed May 15, 2014
1 parent aa07c71 commit 5513a51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfsd/nfs4acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ posix_state_to_acl(struct posix_acl_state *state, unsigned int flags)
add_to_mask(state, &state->groups->aces[i].perms);
}

if (!state->users->n && !state->groups->n) {
if (state->users->n || state->groups->n) {
pace++;
pace->e_tag = ACL_MASK;
low_mode_from_nfs4(state->mask.allow, &pace->e_perm, flags);
Expand Down

0 comments on commit 5513a51

Please sign in to comment.