diff options
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r-- | fs/nfsd/vfs.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 23341c1063bc..a293f0273263 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -89,6 +89,12 @@ struct raparm_hbucket { | |||
89 | #define RAPARM_HASH_MASK (RAPARM_HASH_SIZE-1) | 89 | #define RAPARM_HASH_MASK (RAPARM_HASH_SIZE-1) |
90 | static struct raparm_hbucket raparm_hash[RAPARM_HASH_SIZE]; | 90 | static struct raparm_hbucket raparm_hash[RAPARM_HASH_SIZE]; |
91 | 91 | ||
92 | static inline int | ||
93 | nfsd_v4client(struct svc_rqst *rq) | ||
94 | { | ||
95 | return rq->rq_prog == NFS_PROGRAM && rq->rq_vers == 4; | ||
96 | } | ||
97 | |||
92 | /* | 98 | /* |
93 | * Called from nfsd_lookup and encode_dirent. Check if we have crossed | 99 | * Called from nfsd_lookup and encode_dirent. Check if we have crossed |
94 | * a mount point. | 100 | * a mount point. |
@@ -115,7 +121,8 @@ nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp, | |||
115 | path_put(&path); | 121 | path_put(&path); |
116 | goto out; | 122 | goto out; |
117 | } | 123 | } |
118 | if ((exp->ex_flags & NFSEXP_CROSSMOUNT) || EX_NOHIDE(exp2)) { | 124 | if (nfsd_v4client(rqstp) || |
125 | (exp->ex_flags & NFSEXP_CROSSMOUNT) || EX_NOHIDE(exp2)) { | ||
119 | /* successfully crossed mount point */ | 126 | /* successfully crossed mount point */ |
120 | /* | 127 | /* |
121 | * This is subtle: path.dentry is *not* on path.mnt | 128 | * This is subtle: path.dentry is *not* on path.mnt |
@@ -684,6 +691,8 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
684 | __be32 err; | 691 | __be32 err; |
685 | int host_err; | 692 | int host_err; |
686 | 693 | ||
694 | validate_process_creds(); | ||
695 | |||
687 | /* | 696 | /* |
688 | * If we get here, then the client has already done an "open", | 697 | * If we get here, then the client has already done an "open", |
689 | * and (hopefully) checked permission - so allow OWNER_OVERRIDE | 698 | * and (hopefully) checked permission - so allow OWNER_OVERRIDE |
@@ -740,6 +749,7 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
740 | out_nfserr: | 749 | out_nfserr: |
741 | err = nfserrno(host_err); | 750 | err = nfserrno(host_err); |
742 | out: | 751 | out: |
752 | validate_process_creds(); | ||
743 | return err; | 753 | return err; |
744 | } | 754 | } |
745 | 755 | ||