HomeFreeBSD

rpc: Improve socket locking in svc_vc_accept()

Description

rpc: Improve socket locking in svc_vc_accept()

so_state modifications must be synchronized by the socket lock. For the
listening socket this probably doesn't matter but for the child socket I
think it's possible that this unlocked update clobbers a state
transition if the nascent connection is being disconnected for some
reason.

Also fix the line which potentially clears SS_NBIO in the listening
socket.

It is unclear whether this code is used at all.

Reviewed by: glebius
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55247

(cherry picked from commit 7c1c0e94363db09af0c260d9292160cdd2230f23)

Details

Provenance
markjAuthored on Feb 12 2026, 2:00 PM
Reviewer
glebius
Differential Revision
D55247: rpc: Improve socket locking in svc_vc_accept()
Parents
rG8a84a3c42054: netinet6: Add a struct socket declaration to ip6_var.h
Branches
Unknown
Tags
Unknown