From 6826cf6be8688f6a466d4e0ef9347b44341e9bf2 Mon Sep 17 00:00:00 2001 From: rob Date: Thu, 17 Feb 2022 03:12:34 +0000 Subject: [PATCH] Writes to the ps_flags field of struct process should be atomic. Ok deraadt@ guenther@ --- sys/kern/vfs_syscalls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } -- 2.20.1