diff options
author | kan <kan@FreeBSD.org> | 2009-05-09 18:09:17 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2009-05-09 18:09:17 +0000 |
commit | 7b57a857b7ba934dd819c18d33738253d01f87c5 (patch) | |
tree | e0a6bea48a27765461073d412daf8d760867e537 /sys/nlm | |
parent | 11700d839b55c1904f111a054c18b3ba53a9a98c (diff) | |
download | FreeBSD-src-7b57a857b7ba934dd819c18d33738253d01f87c5.zip FreeBSD-src-7b57a857b7ba934dd819c18d33738253d01f87c5.tar.gz |
Do not embed struct ucred into larger netcred parent structures.
Credential might need to hang around longer than its parent and be used
outside of mnt_explock scope controlling netcred lifetime. Use separate
reference-counted ucred allocated separately instead.
While there, extend mnt_explock coverage in vfs_stdexpcheck and clean-up
some unused declarations in new NFS code.
Reported by: John Hickey
PR: kern/133439
Reviewed by: dfr, kib
Diffstat (limited to 'sys/nlm')
-rw-r--r-- | sys/nlm/nlm_prot_impl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/nlm/nlm_prot_impl.c b/sys/nlm/nlm_prot_impl.c index 1ddaf3e..a46d432 100644 --- a/sys/nlm/nlm_prot_impl.c +++ b/sys/nlm/nlm_prot_impl.c @@ -1752,7 +1752,8 @@ nlm_get_vfs_state(struct nlm_host *host, struct svc_req *rqstp, } if (cred->cr_uid == 0 || (exflags & MNT_EXPORTANON)) { crfree(cred); - cred = crhold(credanon); + cred = credanon; + credanon = NULL; } /* @@ -1772,6 +1773,8 @@ nlm_get_vfs_state(struct nlm_host *host, struct svc_req *rqstp, out: if (cred) crfree(cred); + if (credanon) + crfree(credanon); return (error); } |