diff options
author | Vitaliy Makkoveev <mvs@cvs.openbsd.org> | 2021-12-07 01:19:48 +0000 |
---|---|---|
committer | Vitaliy Makkoveev <mvs@cvs.openbsd.org> | 2021-12-07 01:19:48 +0000 |
commit | 8555e51e3db8c3e12459dddbfa6e478b93e55bc3 (patch) | |
tree | 9cfefaf5cff034a9d52bec54f25f5962905b9d87 /sys/net/if_pppx.c | |
parent | feaea13e9b89c8f232384c72e9d8368e2486d087 (diff) |
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@
Diffstat (limited to 'sys/net/if_pppx.c')
0 files changed, 0 insertions, 0 deletions