From 126e083ddada267194d23cd03cbc00ef578693e5 Mon Sep 17 00:00:00 2001 From: anton Date: Sat, 15 Feb 2020 09:35:49 +0000 Subject: Consistently perform atomic writes to the ps_flags field of struct process. ok bluhm@ claudio@ visa@ --- sys/kern/kern_pledge.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/kern/kern_pledge.c') 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 @@ -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); } -- cgit v1.2.3