From owner-svn-src-stable@FreeBSD.ORG Tue Jun 30 15:23:16 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DEEF1065670; Tue, 30 Jun 2009 15:23:16 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B99D8FC1D; Tue, 30 Jun 2009 15:23:16 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5UFNGwn084564; Tue, 30 Jun 2009 15:23:16 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5UFNGmN084562; Tue, 30 Jun 2009 15:23:16 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200906301523.n5UFNGmN084562@svn.freebsd.org> From: Attilio Rao Date: Tue, 30 Jun 2009 15:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195196 - stable/6/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2009 15:23:17 -0000 Author: attilio Date: Tue Jun 30 15:23:16 2009 New Revision: 195196 URL: http://svn.freebsd.org/changeset/base/195196 Log: If the table is empty we can end up with a NULL pointer. Handle that case trying to free and re-allocate a new object for the timerqueue, managing unallocations. This is not an issue on 7 and further branches. Submitted by: emaste Sponsored by: Sandvine Incorporated Reported by: Kyle Larose Modified: stable/6/sys/netinet/tcp_syncache.c Modified: stable/6/sys/netinet/tcp_syncache.c ============================================================================== --- stable/6/sys/netinet/tcp_syncache.c Tue Jun 30 14:34:06 2009 (r195195) +++ stable/6/sys/netinet/tcp_syncache.c Tue Jun 30 15:23:16 2009 (r195196) @@ -891,13 +891,15 @@ syncache_add(inc, to, th, sop, m) /* NB: guarded by INP_INFO_WLOCK(&tcbinfo) */ for (i = SYNCACHE_MAXREXMTS; i >= 0; i--) { sc = TAILQ_FIRST(&tcp_syncache.timerq[i]); - if (sc != NULL) + if (sc != NULL) { + sc->sc_tp->ts_recent = ticks; + syncache_drop(sc, NULL); + tcpstat.tcps_sc_zonefail++; + sc = uma_zalloc(tcp_syncache.zone, M_NOWAIT | + M_ZERO); break; + } } - sc->sc_tp->ts_recent = ticks; - syncache_drop(sc, NULL); - tcpstat.tcps_sc_zonefail++; - sc = uma_zalloc(tcp_syncache.zone, M_NOWAIT | M_ZERO); if (sc == NULL) { if (ipopts) (void) m_free(ipopts);