diff options
author | 2002-08-22 22:04:42 +0000 | |
---|---|---|
committer | 2002-08-22 22:04:42 +0000 | |
commit | d84dbf2ea0c3f0ce007c0bb9a7d424a77be7846a (patch) | |
tree | a0c02e4e18d4ac434403febc4d6ed3727d385721 /sys/kern/exec_elf.c | |
parent | send signal name (not signal number) in "exit-signal" message; noticed (diff) | |
download | wireguard-openbsd-d84dbf2ea0c3f0ce007c0bb9a7d424a77be7846a.tar.xz wireguard-openbsd-d84dbf2ea0c3f0ce007c0bb9a7d424a77be7846a.zip |
Change the vnode locking in exec to not keep the vnode locked almost all
the time.
This could lead to problems when a process wants to do an exec on the same
vnode it's being run from and needs to copy in arguments from an uncached
page in the data segment. When that happens uvm detects a vnode deadlock
and returns an error causing execve() return EFAULT.
This fixes the regress test in regress/sys/kern/exec_self
Also, initialize scriptvp early in exec_script because it could be
used uninitialized in a failure case.
Diffstat (limited to 'sys/kern/exec_elf.c')
-rw-r--r-- | sys/kern/exec_elf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c index beb231e60aa..078963448ce 100644 --- a/sys/kern/exec_elf.c +++ b/sys/kern/exec_elf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.c,v 1.38 2002/03/14 01:27:03 millert Exp $ */ +/* $OpenBSD: exec_elf.c,v 1.39 2002/08/22 22:04:42 art Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -312,7 +312,7 @@ ELFNAME(read_from)(struct proc *p, struct vnode *vp, u_long off, caddr_t buf, size_t resid; if ((error = vn_rdwr(UIO_READ, vp, buf, size, off, UIO_SYSSPACE, - IO_NODELOCKED, p->p_ucred, &resid, p)) != 0) + 0, p->p_ucred, &resid, p)) != 0) return error; /* * See if we got all of it |