]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
nfsd4: permit read opens of executable-only files
authorJ. Bruce Fields <bfields@redhat.com>
Thu, 25 Aug 2011 14:48:39 +0000 (10:48 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Nov 2011 17:35:57 +0000 (09:35 -0800)
commit0a52cb1083a662d4c417638ccdaa81df0e67494b
tree65347a5bc7318cbd149730df5370e35493ae864d
parente3d0b28c5ec3bf7628a9707a6392cdb4adebabba
nfsd4: permit read opens of executable-only files

commit a043226bc140a2c1dde162246d68a67e5043e6b2 upstream.

A client that wants to execute a file must be able to read it.  Read
opens over nfs are therefore implicitly allowed for executable files
even when those files are not readable.

NFSv2/v3 get this right by using a passed-in NFSD_MAY_OWNER_OVERRIDE on
read requests, but NFSv4 has gotten this wrong ever since
dc730e173785e29b297aa605786c94adaffe2544 "nfsd4: fix owner-override on
open", when we realized that the file owner shouldn't override
permissions on non-reclaim NFSv4 opens.

So we can't use NFSD_MAY_OWNER_OVERRIDE to tell nfsd_permission to allow
reads of executable files.

So, do the same thing we do whenever we encounter another weird NFS
permission nit: define yet another NFSD_MAY_* flag.

The industry's future standardization on 128-bit processors will be
motivated primarily by the need for integers with enough bits for all
the NFSD_MAY_* flags.

Reported-by: Leonardo Borda <leonardoborda@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/nfsd/nfs4proc.c
fs/nfsd/vfs.c
fs/nfsd/vfs.h