Browse Source

[PATCH] nfsd: check for read-only exports before setting acls

We must check for MAY_SATTR before setting acls, which includes checking
for read-only exports: the lower-level setxattr operation that
eventually sets the acl cannot check export-level restrictions.

Bug reported by Martin Walter <mawa@uni-freiburg.de>.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andreas Gruenbacher 19 years ago
parent
commit
b7964c3d88
2 changed files with 2 additions and 2 deletions
  1. 1 1
      fs/nfsd/nfs2acl.c
  2. 1 1
      fs/nfsd/nfs3acl.c

+ 1 - 1
fs/nfsd/nfs2acl.c

@@ -107,7 +107,7 @@ static int nfsacld_proc_setacl(struct svc_rqst * rqstp,
 	dprintk("nfsd: SETACL(2acl)   %s\n", SVCFH_fmt(&argp->fh));
 	dprintk("nfsd: SETACL(2acl)   %s\n", SVCFH_fmt(&argp->fh));
 
 
 	fh = fh_copy(&resp->fh, &argp->fh);
 	fh = fh_copy(&resp->fh, &argp->fh);
-	nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_NOP);
+	nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_SATTR);
 
 
 	if (!nfserr) {
 	if (!nfserr) {
 		nfserr = nfserrno( nfsd_set_posix_acl(
 		nfserr = nfserrno( nfsd_set_posix_acl(

+ 1 - 1
fs/nfsd/nfs3acl.c

@@ -101,7 +101,7 @@ static int nfsd3_proc_setacl(struct svc_rqst * rqstp,
 	int nfserr = 0;
 	int nfserr = 0;
 
 
 	fh = fh_copy(&resp->fh, &argp->fh);
 	fh = fh_copy(&resp->fh, &argp->fh);
-	nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_NOP);
+	nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_SATTR);
 
 
 	if (!nfserr) {
 	if (!nfserr) {
 		nfserr = nfserrno( nfsd_set_posix_acl(
 		nfserr = nfserrno( nfsd_set_posix_acl(