From owner-svn-src-all@FreeBSD.ORG Fri Apr 24 22:11:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 116661065672; Fri, 24 Apr 2009 22:11:54 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F350A8FC0A; Fri, 24 Apr 2009 22:11:53 +0000 (UTC) (envelope-from rwatson@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 n3OMBrhl033455; Fri, 24 Apr 2009 22:11:53 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3OMBrWP033454; Fri, 24 Apr 2009 22:11:53 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904242211.n3OMBrWP033454@svn.freebsd.org> From: Robert Watson Date: Fri, 24 Apr 2009 22:11:53 +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: r191476 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Apr 2009 22:11:54 -0000 Author: rwatson Date: Fri Apr 24 22:11:53 2009 New Revision: 191476 URL: http://svn.freebsd.org/changeset/base/191476 Log: In in_purgemaddrs(), remove the inm being freed from the address list before freeing it, rather than vice version, to avoid potential use after free. Reviewed by: bms Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Fri Apr 24 19:05:22 2009 (r191475) +++ head/sys/netinet/in.c Fri Apr 24 22:11:53 2009 (r191476) @@ -1079,8 +1079,8 @@ in_purgemaddrs(struct ifnet *ifp) IF_ADDR_UNLOCK(ifp); LIST_FOREACH_SAFE(inm, &purgeinms, inm_link, tinm) { - inm_release_locked(inm); LIST_REMOVE(inm, inm_link); + inm_release_locked(inm); } igmp_ifdetach(ifp);