]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
nfsd: drop unnecessary MAY_EXEC check from create
authorJ. Bruce Fields <bfields@redhat.com>
Thu, 21 Jul 2016 20:00:12 +0000 (16:00 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 4 Aug 2016 21:11:52 +0000 (17:11 -0400)
We need an fh_verify to make sure we at least have a dentry, but actual
permission checks happen later.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4proc.c
fs/nfsd/vfs.c

index 9d7e1edf0cca33d74b829300791fbd0278a34671..1fb222752b2b154d1c7171b6c1ea766a8472d09e 100644 (file)
@@ -605,12 +605,7 @@ nfsd4_create(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 
        fh_init(&resfh, NFS4_FHSIZE);
 
-       /*
-        * We just check that parent is accessible here, nfsd_* do their
-        * own access permission checks
-        */
-       status = fh_verify(rqstp, &cstate->current_fh, S_IFDIR,
-                          NFSD_MAY_EXEC);
+       status = fh_verify(rqstp, &cstate->current_fh, S_IFDIR, NFSD_MAY_NOP);
        if (status)
                return status;
 
index 1809624997f0df77c0f1486691a7eaee69cd3942..6666188c11387ebd43852010e97b0d76564da254 100644 (file)
@@ -1236,11 +1236,7 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
        if (isdotent(fname, flen))
                return nfserr_exist;
 
-       /*
-        * Even though it is a create, first let's see if we are even allowed
-        * to peek inside the parent
-        */
-       err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_EXEC);
+       err = fh_verify(rqstp, fhp, S_IFDIR, NFSD_MAY_NOP);
        if (err)
                return err;