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

(cherry picked from commit d795c753e262b97a93dc353aa66b858e1b1969d1)

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
rG58eacc815513: if_ovpn: use IFT_TUNNEL
Branches
Unknown
Tags
Unknown
References
stable/14