From: rob Date: Thu, 17 Feb 2022 03:12:34 +0000 (+0000) Subject: Writes to the ps_flags field of struct process should be atomic. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6826cf6be8688f6a466d4e0ef9347b44341e9bf2;p=openbsd Writes to the ps_flags field of struct process should be atomic. Ok deraadt@ guenther@ --- diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index bfce966733e..31122a286f4 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.355 2022/02/15 23:16:00 rob Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.356 2022/02/17 03:12:34 rob Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -829,7 +829,7 @@ sys_chroot(struct proc *p, void *v, register_t *retval) vrele(old_cdir); } else fdp->fd_rdir = nd.ni_vp; - p->p_p->ps_flags |= PS_CHROOT; + atomic_setbits_int(&p->p_p->ps_flags, PS_CHROOT); return (0); }