diff options
author | anton <anton@cvs.openbsd.org> | 2020-02-15 09:35:49 +0000 |
---|---|---|
committer | anton <anton@cvs.openbsd.org> | 2020-02-15 09:35:49 +0000 |
commit | 126e083ddada267194d23cd03cbc00ef578693e5 (patch) | |
tree | 6fa992a20ab4bafe23be0ad1fd187074c7eed5aa /sys/kern/kern_pledge.c | |
parent | 9f7e48ab7e52c3a434602a331a92467313a8b7ab (diff) |
Consistently perform atomic writes to the ps_flags field of struct
process.
ok bluhm@ claudio@ visa@
Diffstat (limited to 'sys/kern/kern_pledge.c')
-rw-r--r-- | sys/kern/kern_pledge.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index 3769b58d74c..7bcc7636d99 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.260 2020/02/11 16:02:39 deraadt Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.261 2020/02/15 09:35:48 anton Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -488,7 +488,7 @@ sys_pledge(struct proc *p, void *v, register_t *retval) if (SCARG(uap, promises)) { pr->ps_pledge = promises; - pr->ps_flags |= PS_PLEDGE; + atomic_setbits_int(&pr->ps_flags, PS_PLEDGE); /* * Kill off unveil and drop unveil vnode refs if we no * longer are holding any path-accessing pledge @@ -500,7 +500,7 @@ sys_pledge(struct proc *p, void *v, register_t *retval) } if (SCARG(uap, execpromises)) { pr->ps_execpledge = execpromises; - pr->ps_flags |= PS_EXECPLEDGE; + atomic_setbits_int(&pr->ps_flags, PS_EXECPLEDGE); } return (0); } |