From owner-freebsd-current@FreeBSD.ORG Mon May 15 21:57:15 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 995A116B170 for ; Mon, 15 May 2006 21:57:15 +0000 (UTC) (envelope-from maksim.yevmenkin@savvis.net) Received: from mailgate1b.savvis.net (mailgate1b.savvis.net [216.91.182.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9883643D64 for ; Mon, 15 May 2006 21:57:11 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from localhost (localhost.localdomain [127.0.0.1]) by mailgate1b.savvis.net (Postfix) with ESMTP id 03B683BE6A for ; Mon, 15 May 2006 16:57:11 -0500 (CDT) Received: from mailgate1b.savvis.net ([127.0.0.1]) by localhost (mailgate1b.savvis.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 29870-02-3 for ; Mon, 15 May 2006 16:57:10 -0500 (CDT) Received: from [10.254.186.111] (sntc04ep01.savvis.net [64.14.1.106]) by mailgate1b.savvis.net (Postfix) with ESMTP id 9D3353BE44 for ; Mon, 15 May 2006 16:57:10 -0500 (CDT) Message-ID: <4468F92B.90701@savvis.net> Date: Mon, 15 May 2006 14:56:59 -0700 From: Maksim Yevmenkin User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050404) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-current@freebsd.org Content-Type: multipart/mixed; boundary="------------020208060901090307010900" X-Virus-Scanned: amavisd-new at savvis.net Subject: [PATCH] kern/95357: if_tap knlist of vmnet device is incorrectly destroyed by tapclose() X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 May 2006 21:57:17 -0000 This is a multi-part message in MIME format. --------------020208060901090307010900 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit dear hackers, are there any objections to the attached patch? could if_tap/vmnet users please give it a try to see if this fixes the panic on -current? thanks, max --------------020208060901090307010900 Content-Type: text/plain; name="if_tap.c.diff.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="if_tap.c.diff.txt" --- if_tap.c.orig Thu Mar 16 13:04:23 2006 +++ if_tap.c Mon May 15 14:44:14 2006 @@ -219,6 +219,7 @@ KASSERT(!(tp->tap_flags & TAP_OPEN), ("%s flags is out of sync", ifp->if_xname)); + knlist_destroy(&tp->tap_rsel.si_note); destroy_dev(tp->tap_dev); s = splimp(); ether_ifdetach(ifp); @@ -354,6 +355,8 @@ tp->tap_flags |= TAP_INITED; mtx_unlock(&tp->tap_mtx); + knlist_init(&tp->tap_rsel.si_note, NULL, NULL, NULL, NULL); + TAPDEBUG("interface %s is created. minor = %#x\n", ifp->if_xname, minor(dev)); } /* tapcreate */ @@ -405,8 +408,6 @@ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; splx(s); - knlist_init(&tp->tap_rsel.si_note, NULL, NULL, NULL, NULL); - TAPDEBUG("%s is open. minor = %#x\n", ifp->if_xname, minor(dev)); return (0); @@ -458,8 +459,6 @@ tp->tap_flags &= ~TAP_OPEN; tp->tap_pid = 0; mtx_unlock(&tp->tap_mtx); - - knlist_destroy(&tp->tap_rsel.si_note); TAPDEBUG("%s is closed. minor = %#x\n", ifp->if_xname, minor(dev)); --------------020208060901090307010900--