diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-09-02 22:48:32 +0200 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-09-03 22:57:57 +0200 |
commit | 2671a4bf3516757ca028c139a7902a50f2bd994a (patch) | |
tree | 9b60719bdd52cdae10f4b64525c13f072e1ac7b0 /fs/nfsd/export.c | |
parent | nfsd: move fsid_type choice out of fh_compose (diff) | |
download | linux-2671a4bf3516757ca028c139a7902a50f2bd994a.tar.xz linux-2671a4bf3516757ca028c139a7902a50f2bd994a.zip |
NFSd: Fix filehandle leak in exp_pseudoroot() and nfsd4_path()
nfsd4_path() allocates a temporary filehandle and then fails to free it
before the function exits, leaking reference counts to the dentry and
export that it refers to.
Also, nfsd4_lookupp() puts the result of exp_pseudoroot() in a temporary
filehandle which it releases on success of exp_pseudoroot() but not on
failure; fix exp_pseudoroot to ensure that on failure it releases the
filehandle before returning.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/export.c')
-rw-r--r-- | fs/nfsd/export.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index d9462643155c..984a5ebcc1d6 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -1341,6 +1341,8 @@ exp_pseudoroot(struct svc_rqst *rqstp, struct svc_fh *fhp) if (rv) goto out; rv = check_nfsd_access(exp, rqstp); + if (rv) + fh_put(fhp); out: exp_put(exp); return rv; |