diff options
author | 2002-01-20 11:27:52 +0000 | |
---|---|---|
committer | 2002-01-20 11:27:52 +0000 | |
commit | d5f75ac068d4a0953207b975601aab0d6386eb43 (patch) | |
tree | d9fedd09638886ec4c421aaa61a42e5373f961d0 /sys/kern/sys_process.c | |
parent | fix quite appearent bug in cpu_swapin(), missing '&' can easily corrupt (diff) | |
download | wireguard-openbsd-d5f75ac068d4a0953207b975601aab0d6386eb43.tar.xz wireguard-openbsd-d5f75ac068d4a0953207b975601aab0d6386eb43.zip |
When a process is exec:ing mark it with a flag. Check that flag in ptrace
and procfs (and possibly more places in the future) and simply refuse to
fiddle with the execing process. This is an ugly hack, but this far we
haven't been successful in creating a race-free exec.
Diffstat (limited to 'sys/kern/sys_process.c')
-rw-r--r-- | sys/kern/sys_process.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index e20fedf045d..2e27b3d46ea 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_process.c,v 1.15 2002/01/02 02:38:42 art Exp $ */ +/* $OpenBSD: sys_process.c,v 1.16 2002/01/20 11:27:52 art Exp $ */ /* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */ /*- @@ -107,6 +107,9 @@ sys_ptrace(p, v, retval) return (ESRCH); } + if ((t->p_flag & P_INEXEC) != 0) + return (EAGAIN); + /* Make sure we can operate on it. */ switch (SCARG(uap, req)) { case PT_TRACE_ME: |