diff options
author | jhb <jhb@FreeBSD.org> | 2001-01-27 00:01:31 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-01-27 00:01:31 +0000 |
commit | b6baa60b1e807d09641c20b2ff1fe838ddebbd3b (patch) | |
tree | 81781cbbf3ad98f73e64d11188dfe3084b844e12 /sys/compat/linux/linux_misc.c | |
parent | 0c5b7b7672ac24978496b6d8b72a9f4c74349b64 (diff) | |
download | FreeBSD-src-b6baa60b1e807d09641c20b2ff1fe838ddebbd3b.zip FreeBSD-src-b6baa60b1e807d09641c20b2ff1fe838ddebbd3b.tar.gz |
Back out proc locking to protect p_ucred for obtaining additional
references along with the actual obtaining of additional references.
Diffstat (limited to 'sys/compat/linux/linux_misc.c')
-rw-r--r-- | sys/compat/linux/linux_misc.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 10eaa6e..0caff43 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -185,7 +185,6 @@ linux_uselib(struct proc *p, struct linux_uselib_args *args) struct vnode *vp; struct exec *a_out; struct vattr attr; - struct ucred *uc; vm_offset_t vmaddr; unsigned long file_offset; vm_offset_t buffer; @@ -237,21 +236,14 @@ linux_uselib(struct proc *p, struct linux_uselib_args *args) /* * Executable? */ - PROC_LOCK(p); - uc = p->p_ucred; - crhold(uc); - PROC_UNLOCK(p); - error = VOP_GETATTR(vp, &attr, uc, p); - if (error) { - crfree(uc); + error = VOP_GETATTR(vp, &attr, p->p_ucred, p); + if (error) goto cleanup; - } if ((vp->v_mount->mnt_flag & MNT_NOEXEC) || ((attr.va_mode & 0111) == 0) || (attr.va_type != VREG)) { error = ENOEXEC; - crfree(uc); goto cleanup; } @@ -260,21 +252,17 @@ linux_uselib(struct proc *p, struct linux_uselib_args *args) */ if (attr.va_size == 0) { error = ENOEXEC; - crfree(uc); goto cleanup; } /* * Can we access it? */ - error = VOP_ACCESS(vp, VEXEC, uc, p); - if (error) { - crfree(uc); + error = VOP_ACCESS(vp, VEXEC, p->p_ucred, p); + if (error) goto cleanup; - } - error = VOP_OPEN(vp, FREAD, uc, p); - crfree(uc); + error = VOP_OPEN(vp, FREAD, p->p_ucred, p); if (error) goto cleanup; |