From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 02:20:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C24792F; Sun, 6 Apr 2014 02:20:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECB278B2; Sun, 6 Apr 2014 02:20:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s362KgaS020402; Sun, 6 Apr 2014 02:20:42 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s362KgYZ020401; Sun, 6 Apr 2014 02:20:42 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201404060220.s362KgYZ020401@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 6 Apr 2014 02:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264184 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 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: Sun, 06 Apr 2014 02:20:43 -0000 Author: marcel Date: Sun Apr 6 02:20:42 2014 New Revision: 264184 URL: http://svnweb.freebsd.org/changeset/base/264184 Log: Make sure we don't free memory that's already been freed by setting the geom->softc pounter to NULL before freeing the g_slicer softc. In g_slicer_free() the pointer is checked first. Obtained from: Juniper Networks, Inc. Modified: head/sys/geom/geom_slice.c Modified: head/sys/geom/geom_slice.c ============================================================================== --- head/sys/geom/geom_slice.c Sun Apr 6 00:17:41 2014 (r264183) +++ head/sys/geom/geom_slice.c Sun Apr 6 02:20:42 2014 (r264184) @@ -534,11 +534,14 @@ g_slice_new(struct g_class *mp, u_int sl void g_slice_orphan(struct g_consumer *cp) { + struct g_slicer *gsp; g_trace(G_T_TOPOLOGY, "g_slice_orphan(%p/%s)", cp, cp->provider->name); g_topology_assert(); /* XXX: Not good enough we leak the softc and its suballocations */ - g_slice_free(cp->geom->softc); + gsp = cp->geom->softc; + cp->geom->softc = NULL; + g_slice_free(gsp); g_wither_geom(cp->geom, ENXIO); }