Drop Giant and acquire the UNIX domain socket subsystem lock a bit
earlier in unp_connect() so that vp->v_socket can't change between our copying its value to a local variable and later use of that variable. This may have been responsible for a panic during shutdown that I experienced where simultaneous closing of a listen socket by rpcbind and a new connection being made to rpcbind by mountd.
This commit is contained in:
parent
6670049bcf
commit
06c2659597
@ -794,17 +794,17 @@ unp_connect(so, nam, td)
|
||||
error = VOP_ACCESS(vp, VWRITE, td->td_ucred, td);
|
||||
if (error)
|
||||
goto bad;
|
||||
mtx_unlock(&Giant);
|
||||
UNP_LOCK();
|
||||
so2 = vp->v_socket;
|
||||
if (so2 == NULL) {
|
||||
error = ECONNREFUSED;
|
||||
goto bad;
|
||||
goto bad2;
|
||||
}
|
||||
if (so->so_type != so2->so_type) {
|
||||
error = EPROTOTYPE;
|
||||
goto bad;
|
||||
goto bad2;
|
||||
}
|
||||
mtx_unlock(&Giant);
|
||||
UNP_LOCK();
|
||||
if (so->so_proto->pr_flags & PR_CONNREQUIRED) {
|
||||
if (so2->so_options & SO_ACCEPTCONN) {
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user