summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2010-08-02 19:54:07 +0000
committerguenther <guenther@openbsd.org>2010-08-02 19:54:07 +0000
commit458bf05c8809c4e815fe1c53afb84eec1ec811a6 (patch)
tree2dd92f7a5dc3a21e1053b3837208fee97a4ecf27 /sys/kern/kern_exit.c
parentThere is no reason to call the start function upon resume; the network stack (diff)
downloadwireguard-openbsd-458bf05c8809c4e815fe1c53afb84eec1ec811a6.tar.xz
wireguard-openbsd-458bf05c8809c4e815fe1c53afb84eec1ec811a6.zip
Fix knote handling for exiting processes: when triggering a NOTE_EXIT
knote, remove it from the process's klist; after handling those, remove and drop any remaining knotes from the process's klist. Ban attaching knotes to processes that have started exiting or attaching them via the pid of a thread other than the main thread. ok tedu@, deraadt@
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 3302bc6eb00..792f8391340 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exit.c,v 1.96 2010/07/26 01:56:27 guenther Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.97 2010/08/02 19:54:07 guenther Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
@@ -298,8 +298,8 @@ exit1(struct proc *p, int rv, int flags)
p->p_pctcpu = 0;
if ((p->p_flag & P_THREAD) == 0) {
- /* notify interested parties of our demise */
- KNOTE(&pr->ps_klist, NOTE_EXIT);
+ /* notify interested parties of our demise and clean up */
+ knote_processexit(pr);
/*
* Notify parent that we're gone. If we have P_NOZOMBIE