From owner-cvs-src@FreeBSD.ORG Wed Oct 12 19:52:16 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D705F16A420; Wed, 12 Oct 2005 19:52:16 +0000 (GMT) (envelope-from thompsa@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C91243D7E; Wed, 12 Oct 2005 19:52:16 +0000 (GMT) (envelope-from thompsa@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j9CJqGu3066439; Wed, 12 Oct 2005 19:52:16 GMT (envelope-from thompsa@repoman.freebsd.org) Received: (from thompsa@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j9CJqGS3066438; Wed, 12 Oct 2005 19:52:16 GMT (envelope-from thompsa) Message-Id: <200510121952.j9CJqGS3066438@repoman.freebsd.org> From: Andrew Thompson Date: Wed, 12 Oct 2005 19:52:16 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/contrib/pf/net if_pflog.c if_pfsync.c src/sys/net if_bridge.c if_clone.c if_disc.c if_faith.c if_gif.c if_gre.c if_ppp.c if_stf.c src/sys/netinet ip_carp.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2005 19:52:17 -0000 thompsa 2005-10-12 19:52:16 UTC FreeBSD src repository Modified files: sys/contrib/pf/net if_pflog.c if_pfsync.c sys/net if_bridge.c if_clone.c if_disc.c if_faith.c if_gif.c if_gre.c if_ppp.c if_stf.c sys/netinet ip_carp.c Log: Change the reference counting to count the number of cloned interfaces for each cloner. This ensures that ifc->ifc_units is not prematurely freed in if_clone_detach() before the clones are destroyed, resulting in memory modified after free. This could be triggered with if_vlan. Assert that all cloners have been destroyed when freeing the memory. Change all simple cloners to destroy their clones with ifc_simple_destroy() on module unload so the reference count is properly updated. This also cleans up the interface destroy routines and allows future optimisation. Discussed with: brooks, pjd, -current Reviewed by: brooks Revision Changes Path 1.16 +2 -1 src/sys/contrib/pf/net/if_pflog.c 1.24 +1 -1 src/sys/contrib/pf/net/if_pfsync.c 1.24 +2 -1 src/sys/net/if_bridge.c 1.7 +13 -5 src/sys/net/if_clone.c 1.49 +6 -14 src/sys/net/if_disc.c 1.38 +5 -14 src/sys/net/if_faith.c 1.55 +8 -16 src/sys/net/if_gif.c 1.35 +10 -17 src/sys/net/if_gre.c 1.109 +8 -17 src/sys/net/if_ppp.c 1.51 +9 -17 src/sys/net/if_stf.c 1.32 +2 -1 src/sys/netinet/ip_carp.c