svn commit: r302308 - head/sys/kern

Konstantin Belousov kib at FreeBSD.org
Fri Jul 1 20:11:30 UTC 2016


Author: kib
Date: Fri Jul  1 20:11:28 2016
New Revision: 302308
URL: https://svnweb.freebsd.org/changeset/base/302308

Log:
  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)

Modified:
  head/sys/kern/kern_event.c

Modified: head/sys/kern/kern_event.c
==============================================================================
--- head/sys/kern/kern_event.c	Fri Jul  1 19:58:13 2016	(r302307)
+++ head/sys/kern/kern_event.c	Fri Jul  1 20:11:28 2016	(r302308)
@@ -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;
 


More information about the svn-src-head mailing list