Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157374698
D7398.id19020.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D7398.id19020.diff
View Options
Index: sys/kern/uipc_usrreq.c
===================================================================
--- sys/kern/uipc_usrreq.c
+++ sys/kern/uipc_usrreq.c
@@ -1382,10 +1382,23 @@
goto bad2;
}
if (so->so_proto->pr_flags & PR_CONNREQUIRED) {
+
+ unp2 = sotounpcb(so2);
if (so2->so_options & SO_ACCEPTCONN) {
- CURVNET_SET(so2->so_vnet);
- so3 = sonewconn(so2, 0);
- CURVNET_RESTORE();
+
+ /* Ref count for unp2 of so2, before we drop the lock so that we
+ * dont loose unp2 from under in uipc_detach.
+ */
+ unp2->unp_refcount++;
+ UNP_LINK_WUNLOCK();
+ CURVNET_SET(so2->so_vnet);
+ so3 = sonewconn(so2, 0);
+ CURVNET_RESTORE();
+ UNP_LINK_WLOCK();
+ unp2->unp_refcount--;
+ /* make sure v_socket is stable as we dropped the lock earlier. */
+ VOP_UNP_CONNECT(vp, &so2);
+
} else
so3 = NULL;
if (so3 == NULL) {
@@ -1393,7 +1406,6 @@
goto bad2;
}
unp = sotounpcb(so);
- unp2 = sotounpcb(so2);
unp3 = sotounpcb(so3);
UNP_PCB_LOCK(unp);
UNP_PCB_LOCK(unp2);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 21, 6:28 PM (7 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33401877
Default Alt Text
D7398.id19020.diff (1 KB)
Attached To
Mode
D7398: Recursive lock panic of UNP_LINK_WLOCK
Attached
Detach File
Event Timeline
Log In to Comment