HomeFreeBSD

Ensure that knotes do not get registered when KQ_CLOSING is set.

Description

Ensure that knotes do not get registered when KQ_CLOSING is set.

KQ_CLOSING is set before draining the knotes associated with a kqueue,
so we must ensure that new knotes are not added after that point. In
particular, some kernel facilities may register for events on behalf
of a userspace process and race with a close of the kqueue.

PR: 228858
Reviewed by: kib
Tested by: pho
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18316

Details

Provenance
markjAuthored on
Reviewer
kib
Differential Revision
D18316: Fix some EVFILT_PROC-related race conditions.
Parents
rS340897: Lock the knlist before releasing the in-flux state in knote_fork().
Branches
Unknown
Tags
Unknown