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

knfsd: nfsd: allow auth_sys nlm on rpcsec_gss exports

Our clients (like other clients, as far as I know) use only auth_sys for nlm,
even when using rpcsec_gss for the main nfs operations.

Administrators that want to deny non-kerberos-authenticated locking requests
will need to turn off NFS protocol versions less than 4....

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

J. Bruce Fields and committed by
Linus Torvalds
9091224f 4796f457

+10 -4
+10 -4
fs/nfsd/nfsfh.c
··· 249 249 if (error) 250 250 goto out; 251 251 252 - /* Check security flavor */ 253 - error = check_nfsd_access(exp, rqstp); 254 - if (error) 255 - goto out; 252 + if (!(access & MAY_LOCK)) { 253 + /* 254 + * pseudoflavor restrictions are not enforced on NLM, 255 + * which clients virtually always use auth_sys for, 256 + * even while using RPCSEC_GSS for NFS. 257 + */ 258 + error = check_nfsd_access(exp, rqstp); 259 + if (error) 260 + goto out; 261 + } 256 262 257 263 /* Finally, check access permissions. */ 258 264 error = nfsd_permission(rqstp, exp, dentry, access);