diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2021-02-15 09:36:00 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2021-02-15 09:36:00 +0000 |
commit | 0ea81fc761fae4ef7c99dc61bf01bd3a4a72b1e9 (patch) | |
tree | c2ee2254e9e940383c7d317e9b8f2e2c636ff594 /sys/kern/kern_sig.c | |
parent | 395c8f90612c3637dd665f1cee30509dd634d3c9 (diff) |
Move single_thread_set() out of KERNEL_LOCK().
Use the SCHED_LOCK() to ensure `ps_thread' isn't being modified by a sibling
when entering tsleep(9) w/o KERNEL_LOCK().
ok visa@
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r-- | sys/kern/kern_sig.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 6435794c833..97d99967826 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.272 2021/02/08 10:51:01 mpi Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.273 2021/02/15 09:35:59 mpi Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -1209,11 +1209,7 @@ issignal(struct proc *p) signum != SIGKILL) { pr->ps_xsig = signum; - if (dolock) - KERNEL_LOCK(); single_thread_set(p, SINGLE_PTRACE, 0); - if (dolock) - KERNEL_UNLOCK(); if (dolock) SCHED_LOCK(s); @@ -2009,7 +2005,6 @@ single_thread_set(struct proc *p, enum single_thread_mode mode, int deep) struct proc *q; int error, s; - KERNEL_ASSERT_LOCKED(); KASSERT(curproc == p); SCHED_LOCK(s); |