K 10 svn:author V 3 kib K 8 svn:date V 27 2015-07-09T09:22:21.408390Z K 7 svn:log V 695 Cover a race between doselwakeup() and selfdfree(). If doselwakeup() loop finds the selfd entry and clears its sf_si pointer, which is handled by selfdfree() in parallel, NULL sf_si makes selfdfree() free the memory. The result is the race and accesses to the freed memory. Refcount the selfd ownership. One reference is for the sf_link linkage, which is unconditionally dereferenced by selfdfree(). Another reference is for sf_threads, both selfdfree() and doselwakeup() race to deref it, the winner unlinks and than frees the selfd entry. Reported by: Larry Rosenman Tested by: Larry Rosenman , pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks END