summaryrefslogtreecommitdiff
path: root/sys/kern/kern_sig.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2019-05-01 06:26:43 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2019-05-01 06:26:43 +0000
commiteb3211fd97527b4f083f1b4fa25153c70844a87a (patch)
tree54ab06ddf0df53b3a9623c6e4bcfb453751b14ae /sys/kern/kern_sig.c
parentbc17cbe150c909b7a6b2df9c01ca09c836b49887 (diff)
add a KERNEL_ASSERT_LOCKED() to ptsignal
it obviously needs to be called with the kernel lock held, so it makes sense to check that so we can unlock more code without introducing bugs that shoot us in the face in the indeterminate future. csignal is basically a wrapper around ptsignal, so calls to that without the kernel lock should be caught by this too. discussed with mpi@ on bugs@
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r--sys/kern/kern_sig.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 39a789987e5..fc538174c1a 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.228 2019/02/19 22:42:41 tedu Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.229 2019/05/01 06:26:42 dlg Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -889,6 +889,8 @@ ptsignal(struct proc *p, int signum, enum signal_type type)
struct proc *q;
int wakeparent = 0;
+ KERNEL_ASSERT_LOCKED();
+
#ifdef DIAGNOSTIC
if ((u_int)signum >= NSIG || signum == 0)
panic("psignal signal number");