]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
When detaching an unix domain socket, uipc_detach() checks
authortrociny <trociny@FreeBSD.org>
Sat, 25 Feb 2012 10:15:41 +0000 (10:15 +0000)
committertrociny <trociny@FreeBSD.org>
Sat, 25 Feb 2012 10:15:41 +0000 (10:15 +0000)
commit87f7f0cfe8d3d17bc154ca2c0dcd51bca1444006
tree8d321a0d4dfa05d863db2db15721bdb62ad66f41
parent1227707e5566e30c536ae473402e3c3445c746c1
When detaching an unix domain socket, uipc_detach() checks
unp->unp_vnode pointer to detect if there is a vnode associated with
(binded to) this socket and does necessary cleanup if there is.

The issue is that after forced unmount this check may be too late as
the unp_vnode is reclaimed and the reference is stale.

To fix this provide a helper function that is called on a socket vnode
reclamation to do necessary cleanup.

Pointed by: kib
Reviewed by: kib
MFC after: 2 weeks
sys/kern/uipc_usrreq.c
sys/kern/vfs_subr.c
sys/sys/vnode.h