diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-04-03 14:56:29 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-04-03 14:56:29 +0000 |
commit | 445a93dfa951cfdb8d9253fd13836d6a25a4ac4b (patch) | |
tree | 9248ed7a9eb63023a13f069c04bd049ee460f416 /sys/arch/solbourne | |
parent | e3f9e42db6dd7e48f8bd5a3da7d5b2bb44f3752f (diff) |
Move PPWAIT flag from struct proc to process, so that rthreads in
a vforked child behave correctly. Have the parent in a vfork()
wait on a (different) flag in *its* process instead of the child
to prevent a possible use-after-free. When ktracing the child
return from a fork, call it rfork if an rthread was created.
ok blambert@
Diffstat (limited to 'sys/arch/solbourne')
-rw-r--r-- | sys/arch/solbourne/solbourne/trap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/arch/solbourne/solbourne/trap.c b/sys/arch/solbourne/solbourne/trap.c index 2c613279751..254b2aae4e6 100644 --- a/sys/arch/solbourne/solbourne/trap.c +++ b/sys/arch/solbourne/solbourne/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.11 2009/04/10 20:57:28 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.12 2011/04/03 14:56:28 guenther Exp $ */ /* OpenBSD: trap.c,v 1.42 2004/12/06 20:12:25 miod Exp */ /* @@ -962,6 +962,8 @@ child_return(arg) #ifdef KTRACE if (KTRPOINT(p, KTR_SYSRET)) ktrsysret(p, - (p->p_flag & P_PPWAIT) ? SYS_vfork : SYS_fork, 0, 0); + (p->p_flag & P_THREAD) ? SYS_rfork : + (p->p_p->ps_flags & PS_PPWAIT) ? SYS_vfork : SYS_fork, + 0, 0); #endif } |