Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Jun 2014 15:18:50 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r267112 - stable/9/sys/net
Message-ID:  <201406051518.s55FIoap019792@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Thu Jun  5 15:18:49 2014
New Revision: 267112
URL: http://svnweb.freebsd.org/changeset/base/267112

Log:
  MFC r240938, r240942: Avoid INVARIANTS panic destroying an in-use tap(4)
  
    The requirement (implied by the KASSERT in tap_destroy) that the tap is
    closed isn't valid; destroy_dev will block in devdrn while other threads
    are in d_* functions.
  
    Note: if_tun had the same issue, addressed in SVN revisions r186391,
    r186483 and r186497.  The use of the condvar there appears to be
    redundant with the functionality provided by destroy_dev.
  
  PR:		172075
  Approved by:	re

Modified:
  stable/9/sys/net/if_tap.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/net/   (props changed)

Modified: stable/9/sys/net/if_tap.c
==============================================================================
--- stable/9/sys/net/if_tap.c	Thu Jun  5 15:16:44 2014	(r267111)
+++ stable/9/sys/net/if_tap.c	Thu Jun  5 15:18:49 2014	(r267112)
@@ -213,14 +213,10 @@ tap_destroy(struct tap_softc *tp)
 {
 	struct ifnet *ifp = tp->tap_ifp;
 
-	/* Unlocked read. */
-	KASSERT(!(tp->tap_flags & TAP_OPEN),
-		("%s flags is out of sync", ifp->if_xname));
-
 	CURVNET_SET(ifp->if_vnet);
+	destroy_dev(tp->tap_dev);
 	seldrain(&tp->tap_rsel);
 	knlist_destroy(&tp->tap_rsel.si_note);
-	destroy_dev(tp->tap_dev);
 	ether_ifdetach(ifp);
 	if_free_type(ifp, IFT_ETHER);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406051518.s55FIoap019792>