Fix knote handling for exiting processes: when triggering a NOTE_EXIT
authorguenther <guenther@openbsd.org>
Mon, 2 Aug 2010 19:54:07 +0000 (19:54 +0000)
committerguenther <guenther@openbsd.org>
Mon, 2 Aug 2010 19:54:07 +0000 (19:54 +0000)
commit458bf05c8809c4e815fe1c53afb84eec1ec811a6
tree2dd92f7a5dc3a21e1053b3837208fee97a4ecf27
parentec67ec1357878da0c980c55bc72cdd57d90650b3
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@
sys/kern/kern_event.c
sys/kern/kern_exit.c
sys/sys/event.h