summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authorjoshe <joshe@openbsd.org>2011-11-22 23:20:19 +0000
committerjoshe <joshe@openbsd.org>2011-11-22 23:20:19 +0000
commita9b1ac2111b2ea40bc796c5c55e432f4bfed8207 (patch)
tree0c199f9fafbd65de79f24d4e659656bd21a10831 /sys/kern/kern_fork.c
parentAdd a test for forked processes inheriting their parent's signal stack. (diff)
downloadwireguard-openbsd-a9b1ac2111b2ea40bc796c5c55e432f4bfed8207.tar.xz
wireguard-openbsd-a9b1ac2111b2ea40bc796c5c55e432f4bfed8207.zip
Move struct proc's sigaltstack struct from the zeroed area into the
copied area, and initialize it properly in the FORK_THREAD case. This restores the behavior of a forked process inheriting its parent's signal stack. ok guenther@
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r--sys/kern/kern_fork.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 7d608152c00..f5cd1f8eeb2 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_fork.c,v 1.131 2011/11/09 20:57:38 guenther Exp $ */
+/* $OpenBSD: kern_fork.c,v 1.132 2011/11/22 23:20:19 joshe Exp $ */
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
/*
@@ -388,6 +388,8 @@ fork1(struct proc *curp, int exitsig, int flags, void *stack, pid_t *tidptr,
p->p_sigacts = sigactsshare(curp);
else
p->p_sigacts = sigactsinit(curp);
+ if (flags & FORK_THREAD)
+ sigstkinit(&p->p_sigstk);
/*
* If emulation has process fork hook, call it now.