]> git.baikalelectronics.ru Git - kernel.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)
committerJ. Bruce Fields <bfields@redhat.com>
Sat, 27 Aug 2011 18:20:20 +0000 (14:20 -0400)
commitd68a1e734428f4476e6e9568c1e3f7928f3fcd0f
tree8d2f2a52835d37150c0cae42787903793e57bd86
parent3b92bd61ea7c6a7b507edb4f645613df72ee2fb4
nfsd4: permit read opens of executable-only files

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
035d047c7c3ba7ed5bf3343923252a763b30d5d2 "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>
Cc: stable@kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4proc.c
fs/nfsd/vfs.c
fs/nfsd/vfs.h