From ac4bc0c171f8839e74d9f0bcd8e5e31322167361 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 21 Jun 2018 21:07:25 +0000 Subject: [PATCH] Update proc->p_ptevents annotation to reflect the actual locking. Submitted by: Yanko Yankulov Reviewed by: jhb MFC after: 1 week Differential revision: https://reviews.freebsd.org/D15954 --- sys/kern/sys_process.c | 1 + sys/sys/proc.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 5129f1123448..af3199468bc2 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -688,6 +688,7 @@ void proc_set_traced(struct proc *p, bool stop) { + sx_assert(&proctree_lock, SX_XLOCKED); PROC_LOCK_ASSERT(p, MA_OWNED); p->p_flag |= P_TRACED; if (stop) diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 0bc0e1a67b45..9c6b4d26e71b 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -633,7 +633,7 @@ struct proc { u_int p_stype; /* (c) Stop event type. */ char p_step; /* (c) Process is stopped. */ u_char p_pfsflags; /* (c) Procfs flags. */ - u_int p_ptevents; /* (c) ptrace() event mask. */ + u_int p_ptevents; /* (c + e) ptrace() event mask. */ struct nlminfo *p_nlminfo; /* (?) Only used by/for lockd. */ struct kaioinfo *p_aioinfo; /* (y) ASYNC I/O info. */ struct thread *p_singlethread;/* (c + j) If single threading this is it */