HomeFreeBSD

kevent: Hold the knlist mutex when invoking f_event(NOTE_FORK)

Description

kevent: Hold the knlist mutex when invoking f_event(NOTE_FORK)

In general f_event is supposed to be called with the knlist mutex held,
so lock it earlier to follow this protocol. Also make sure that the
update to kn_fflags is synchronized.

Lock the kqueue itself earlier in the case where the knote is activated,
to avoid locking and unlocking the kqueue twice.

PR: 291005
Reported by: Qiu-ji Chen <chenqiuji666@gmail.com>
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53762

Details

Provenance
markjAuthored on Tue, Nov 18, 2:22 PM
Reviewer
kib
Differential Revision
D53762: kevent: Hold the knlist mutex when invoking f_event(NOTE_FORK)
Parents
rG39ee24182b92: rc.subr: Support setting the audit user when starting services
Branches
Unknown
Tags
Unknown