summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2016-09-03 14:29:06 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2016-09-03 14:29:06 +0000
commitb9d6112faf35f4cc5d204ebfc255dc4e38efbc20 (patch)
treec7e62ccdc7017f9fd6442abd6ad9be77eaaf916e /sys/kern
parent1e078edf53294ea86ccd7614e29c144079a589c2 (diff)
Inherit PS_WXNEEDED in forked processes.
Issue noticed when debugging lang/sbcl. ok deraadt@ guenther@ tedu@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_fork.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 8f71c6188f9..de299003ff7 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_fork.c,v 1.188 2016/08/31 14:15:07 tom Exp $ */
+/* $OpenBSD: kern_fork.c,v 1.189 2016/09/03 14:29:05 jca Exp $ */
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
/*
@@ -201,7 +201,8 @@ process_new(struct proc *p, struct process *parent, int flags)
if (pr->ps_textvp)
vref(pr->ps_textvp);
- pr->ps_flags = parent->ps_flags & (PS_SUGID | PS_SUGIDEXEC | PS_PLEDGE);
+ pr->ps_flags = parent->ps_flags &
+ (PS_SUGID | PS_SUGIDEXEC | PS_PLEDGE | PS_WXNEEDED);
if (parent->ps_session->s_ttyvp != NULL)
pr->ps_flags |= parent->ps_flags & PS_CONTROLT;