When a process knote was attached to the process which is already exiting,

the knote is activated immediately.  If the exit1() later activates
knotes, such knote is attempted to be activated second time.  Detect
the condition by zeroed kn_ptr.p_proc pointer, and avoid excessive
activation.

Before r302235, such knotes were removed from the knlist immediately
upon activation.

Reported by:	truckman
Sponsored by:	The FreeBSD Foundation
Approved by:	re (gjb)
This commit is contained in:
kib 2016-07-01 20:11:28 +00:00
parent d6284376d0
commit 38d067a317

View File

@ -451,6 +451,9 @@ filt_proc(struct knote *kn, long hint)
u_int event;
p = kn->kn_ptr.p_proc;
if (p == NULL) /* already activated, from attach filter */
return (0);
/* Mask off extra data. */
event = (u_int)hint & NOTE_PCTRLMASK;