Do not attempt to report proc event if NOTE_EXIT has already been received.

This fixes a race condition (specifically with signal events) that could
lead to the kn being re-inserted into the list after it has been destroyed,
which is not something we want to happen.

PR:		kern/58258
This commit is contained in:
Olivier Houchard 2003-11-04 01:14:58 +00:00
parent 93c3f67fe7
commit f44004690c

View File

@ -279,6 +279,13 @@ filt_proc(struct knote *kn, long hint)
return (1);
}
/*
* Process will already be reported as gone.
* Do not report anything else, as the knote will be destroyed soon.
*/
if (kn->kn_status & KN_DETACHED)
return (0);
/*
* process forked, and user wants to track the new process,
* so attach a new knote to it, and immediately report an