Skip to content

Commit 6640556

Browse files
committed
NFSD: Replace use of NFSD_MAY_LOCK in nfsd4_lock()
NFSv4 LOCK operations should not avoid the set of authorization checks that apply to all other NFSv4 operations. Also, the "no_auth_nlm" export option should apply only to NLM LOCK requests. It's not necessary or sensible to apply it to NFSv4 LOCK operations. Instead, set no permission bits when calling fh_verify(). Subsequent stateid processing handles authorization checks. Reported-by: NeilBrown <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent ed9887b commit 6640556

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

fs/nfsd/nfs4state.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7965,11 +7965,9 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
79657965
if (check_lock_length(lock->lk_offset, lock->lk_length))
79667966
return nfserr_inval;
79677967

7968-
if ((status = fh_verify(rqstp, &cstate->current_fh,
7969-
S_IFREG, NFSD_MAY_LOCK))) {
7970-
dprintk("NFSD: nfsd4_lock: permission denied!\n");
7968+
status = fh_verify(rqstp, &cstate->current_fh, S_IFREG, 0);
7969+
if (status != nfs_ok)
79717970
return status;
7972-
}
79737971
sb = cstate->current_fh.fh_dentry->d_sb;
79747972

79757973
if (lock->lk_is_new) {

0 commit comments

Comments
 (0)