From owner-svn-src-head@FreeBSD.ORG Fri Jun 3 14:57:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCE7C106568B; Fri, 3 Jun 2011 14:57:38 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC5CF8FC15; Fri, 3 Jun 2011 14:57:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p53EvcwX068631; Fri, 3 Jun 2011 14:57:38 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p53Evc7P068629; Fri, 3 Jun 2011 14:57:38 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <201106031457.p53Evc7P068629@svn.freebsd.org> From: "Christian S.J. Peron" Date: Fri, 3 Jun 2011 14:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222654 - head/contrib/libpcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2011 14:57:39 -0000 Author: csjp Date: Fri Jun 3 14:57:38 2011 New Revision: 222654 URL: http://svn.freebsd.org/changeset/base/222654 Log: Explicitly initialize the packet buffer to NULL after we unmap the zero copy buffers. This fixes a segfault on exit due to calling free on a bogus pointer. This should be considered a temporary stop gap fix to avoid the crash. The complete fix re-shuffles the initializations of some of the clean-up pointers. The details of the fix can be found in the libpcap git repository: commit bc8209b71e928870b0f172d43b174ab27ba24394 Proded by: kevlo, rpaulo MFC after: 2 weeks Submitted by: Anton Yuzhaninov Modified: head/contrib/libpcap/pcap-bpf.c Modified: head/contrib/libpcap/pcap-bpf.c ============================================================================== --- head/contrib/libpcap/pcap-bpf.c Fri Jun 3 14:34:38 2011 (r222653) +++ head/contrib/libpcap/pcap-bpf.c Fri Jun 3 14:57:38 2011 (r222654) @@ -1281,6 +1281,7 @@ pcap_cleanup_bpf(pcap_t *p) munmap(p->md.zbuf1, p->md.zbufsize); if (p->md.zbuf2 != MAP_FAILED && p->md.zbuf2 != NULL) munmap(p->md.zbuf2, p->md.zbufsize); + p->buffer = NULL; } #endif if (p->md.device != NULL) {