summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_util.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-12-15 19:41:27 +0000
committerjhb <jhb@FreeBSD.org>2000-12-15 19:41:27 +0000
commit81c40ecc9ceba6e061fd35e0d08c8c37d3121aee (patch)
tree7e104248a7cb66a32e98b1b0efcd4193e1b3433e /sys/compat/linux/linux_util.c
parente761ef905bfe40800a70e05c7023a3a4acaa364b (diff)
downloadFreeBSD-src-81c40ecc9ceba6e061fd35e0d08c8c37d3121aee.zip
FreeBSD-src-81c40ecc9ceba6e061fd35e0d08c8c37d3121aee.tar.gz
Lock access to proc members.
Glanced over by: marcel
Diffstat (limited to 'sys/compat/linux/linux_util.c')
-rw-r--r--sys/compat/linux/linux_util.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_util.c b/sys/compat/linux/linux_util.c
index 6399805..f4fe8d7 100644
--- a/sys/compat/linux/linux_util.c
+++ b/sys/compat/linux/linux_util.c
@@ -62,6 +62,7 @@ linux_emul_find(p, sgp, prefix, path, pbuf, cflag)
struct nameidata ndroot;
struct vattr vat;
struct vattr vatroot;
+ struct ucred *uc;
int error;
char *ptr, *buf, *cp;
size_t sz, len;
@@ -140,12 +141,18 @@ linux_emul_find(p, sgp, prefix, path, pbuf, cflag)
return error;
}
- if ((error = VOP_GETATTR(nd.ni_vp, &vat, p->p_ucred, p)) != 0) {
+ PROC_LOCK(p);
+ uc = p->p_ucred;
+ crhold(uc);
+ PROC_UNLOCK(p);
+ if ((error = VOP_GETATTR(nd.ni_vp, &vat, uc, p)) != 0) {
+ crfree(uc);
goto bad;
}
- if ((error = VOP_GETATTR(ndroot.ni_vp, &vatroot, p->p_ucred, p))
- != 0) {
+ error = VOP_GETATTR(ndroot.ni_vp, &vatroot, uc, p);
+ crfree(uc);
+ if (error != 0) {
goto bad;
}
OpenPOWER on IntegriCloud