diff options
author | J. Bruce Fields <bfields@redhat.com> | 2014-05-15 03:57:26 +0200 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-05-15 21:36:04 +0200 |
commit | 5513a510fad73594e29e1e48e760e0a644a8a4f3 (patch) | |
tree | c335e148d1eaf2ba7a89072e4a3b64322a389535 /fs/nfsd/nfs4acl.c | |
parent | NFSD: Call ->set_acl with a NULL ACL structure if no entries (diff) | |
download | linux-5513a510fad73594e29e1e48e760e0a644a8a4f3.tar.xz linux-5513a510fad73594e29e1e48e760e0a644a8a4f3.zip |
nfsd4: fix corruption on setting an ACL.
As of 06f9cc12caa862f5bc86ebdb4f77568a4bef0167 "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>
Diffstat (limited to 'fs/nfsd/nfs4acl.c')
-rw-r--r-- | fs/nfsd/nfs4acl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c index b6f46013dddf..f66c66b9f182 100644 --- a/fs/nfsd/nfs4acl.c +++ b/fs/nfsd/nfs4acl.c @@ -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); |