svn commit: r264342 - head/sys/netinet
John Baldwin
jhb at FreeBSD.org
Fri Apr 11 13:11:43 UTC 2014
Author: jhb
Date: Fri Apr 11 13:11:43 2014
New Revision: 264342
URL: http://svnweb.freebsd.org/changeset/base/264342
Log:
Don't leak the TCP pcbinfo lock if a time wait connection is closed
in between grabbing a reference on the connection structure and obtaining
the pcbinfo lock.
Reviewed by: Julien Charbon
Modified:
head/sys/netinet/tcp_timewait.c
Modified: head/sys/netinet/tcp_timewait.c
==============================================================================
--- head/sys/netinet/tcp_timewait.c Fri Apr 11 11:56:16 2014 (r264341)
+++ head/sys/netinet/tcp_timewait.c Fri Apr 11 13:11:43 2014 (r264342)
@@ -731,8 +731,10 @@ tcp_tw_2msl_scan(void)
/* Close timewait state */
if (INP_INFO_TRY_WLOCK(&V_tcbinfo)) {
TW_WLOCK(V_tw_lock);
- if (tw_pcbrele(tw))
+ if (tw_pcbrele(tw)) {
+ INP_INFO_WUNLOCK(&V_tcbinfo);
continue;
+ }
KASSERT(tw->tw_inpcb != NULL,
("%s: tw->tw_inpcb == NULL", __func__));
More information about the svn-src-head
mailing list