Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

+2 -4
+2 -4
fs/nfsd/nfs4state.c
··· 7965 7965 if (check_lock_length(lock->lk_offset, lock->lk_length)) 7966 7966 return nfserr_inval; 7967 7967 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) 7971 7970 return status; 7972 - } 7973 7971 sb = cstate->current_fh.fh_dentry->d_sb; 7974 7972 7975 7973 if (lock->lk_is_new) {