summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authoranton <anton@openbsd.org>2020-02-15 09:35:48 +0000
committeranton <anton@openbsd.org>2020-02-15 09:35:48 +0000
commit9648c32b5e7e65e0141b1dc6d1f8958e75832948 (patch)
tree567a0cc70ac8927e7af00feafcf1aab416fa97af /sys/kern/kern_exec.c
parentmention iwx(4) in pci(4) man page; reminded by jmc (diff)
downloadwireguard-openbsd-9648c32b5e7e65e0141b1dc6d1f8958e75832948.tar.xz
wireguard-openbsd-9648c32b5e7e65e0141b1dc6d1f8958e75832948.zip
Consistently perform atomic writes to the ps_flags field of struct
process. ok bluhm@ claudio@ visa@
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 39af7a3de4b..20480c2fc28 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exec.c,v 1.212 2019/12/11 07:30:09 guenther Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.213 2020/02/15 09:35:48 anton Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
@@ -701,9 +701,9 @@ sys_execve(struct proc *p, void *v, register_t *retval)
p->p_descfd = pack.ep_fd;
if (pack.ep_flags & EXEC_WXNEEDED)
- p->p_p->ps_flags |= PS_WXNEEDED;
+ atomic_setbits_int(&p->p_p->ps_flags, PS_WXNEEDED);
else
- p->p_p->ps_flags &= ~PS_WXNEEDED;
+ atomic_clearbits_int(&p->p_p->ps_flags, PS_WXNEEDED);
/* update ps_emul, the old value is no longer needed */
pr->ps_emul = pack.ep_emul;