diff options
author | Steve Dickson <SteveD@redhat.com> | 2009-09-09 15:06:05 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-12-15 14:07:24 -0500 |
commit | 03a816b46d7eba78da11e4025f0af195b32fa464 (patch) | |
tree | 5069e9183dd5535c61bc7eff8a8a03202a19568d /fs/nfsd/nfsd.h | |
parent | f2ca7153ca49a407ea1c7232c9fa7e9849f03f9c (diff) | |
download | linux-03a816b46d7eba78da11e4025f0af195b32fa464.tar.bz2 |
nfsd: restrict filehandles accepted in V4ROOT case
On V4ROOT exports, only accept filehandles that are the *root* of some
export. This allows mountd to allow or deny access to individual
directories and symlinks on the pseudofilesystem.
Note that the checks in readdir and lookup are not enough, since a
malicious host with access to the network could guess filehandles that
they weren't able to obtain through lookup or readdir.
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/nfsd.h')
-rw-r--r-- | fs/nfsd/nfsd.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h index 74f67c2aca34..ac121ad16540 100644 --- a/fs/nfsd/nfsd.h +++ b/fs/nfsd/nfsd.h @@ -70,6 +70,11 @@ int nfsd_create_serv(void); extern int nfsd_max_blksize; +static inline int nfsd_v4client(struct svc_rqst *rq) +{ + return rq->rq_prog == NFS_PROGRAM && rq->rq_vers == 4; +} + /* * NFSv4 State */ |