CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2021/12/06 18:19:47
Modified files:
sys/kern : uipc_usrreq.c
sys/sys : unpcb.h
Log message:
Make `unp_msgcount' and `unp_file' protection with `unp_gc_lock'
rwlock(9).
This save us from from races provided by unlocked access to the `f_count'
which cause false marking alive socket as dead. We always modify `f_count'
and `unp_msgcount' together so the `f_count' modification should also pass
the `unp_gc_rwlock' before `unp_msgcount' increment and after
`unp_msgcount' decrement. The locked `unp_file' assignment avoids us from
drain unp_gc() run.
This moves unp_gc() locking back when these wariables were protected with
the same lock which was taken for all garbage collector run but uses
another lock not `unp_lock'.
ok kettenis@ bluhm@