HomeFreeBSD

Fix a potential socket leak in the NFS server. If a client closes its

Description

Fix a potential socket leak in the NFS server. If a client closes its
connection after it was accepted by the userland nfsd process but before
it was handled off to svc_vc_create() in the kernel, then svc_vc_create()
would see it as a new listen socket and try to listen on it leaving a
dangling reference to the socket. Instead, check for disconnected sockets
and treat them like a connected socket. The call to pru_getaddr() should
fail and cause svc_vc_create() to fail. Note that we need to lock the
socket to get a consistent snapshot of so_state since there is a window
in soisdisconnected() where both flags are clear.

Reviewed by: dfr, rmacklem
MFC after: 1 week

Details

Provenance
jhbAuthored on Apr 8 2013, 7:03 PM
Parents
rG8f660592005b: Switch to a 2-clause license.
Branches
Unknown
Tags
Unknown

Event Timeline