summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2019-05-01 06:26:42 +0000
committerdlg <dlg@openbsd.org>2019-05-01 06:26:42 +0000
commitef92b62d0f16b22e760225868f981f03ff078734 (patch)
tree730316466247bdedffd9923a031b1516417afe30 /sys
parentupdate currency exchange rates; (diff)
downloadwireguard-openbsd-ef92b62d0f16b22e760225868f981f03ff078734.tar.xz
wireguard-openbsd-ef92b62d0f16b22e760225868f981f03ff078734.zip
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')
-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");