Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jun 2016 10:32:27 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        Navdeep Parhar <np@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r302054 - in head/sys: contrib/ipfilter/netinet dev/usb/net kern net netgraph netinet netinet6 netipsec netpfil/ipfw netpfil/pf
Message-ID:  <alpine.BSF.2.00.1606221031500.4366@ai.fobar.qr>
In-Reply-To: <c2edc988-92db-0f73-d9d5-6cf29b2c7706@FreeBSD.org>
References:  <201606211348.u5LDmom9081605@repo.freebsd.org> <c2edc988-92db-0f73-d9d5-6cf29b2c7706@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 21 Jun 2016, Navdeep Parhar wrote:

> This causes a panic when a NIC driver module is unloaded from a kernel
> without VIMAGE.  if_vnet is NULL and if_detach_internal tries to
> dereference it.

whoops;

I'll try this patch in a few minutes but if it works for you let me
know and I'll get it in.

Index: sys/net/if.c
===================================================================
--- sys/net/if.c        (revision 302079)
+++ sys/net/if.c        (working copy)
@@ -933,8 +933,12 @@ if_detach_internal(struct ifnet *ifp, int vmove, s
         struct ifnet *iter;
         int found = 0, shutdown;

+#ifdef VIMAGE
         shutdown = (ifp->if_vnet->vnet_state > SI_SUB_VNET &&
                  ifp->if_vnet->vnet_state < SI_SUB_VNET_DONE) ? 1 : 0;
+#else
+       shutdown = 0;
+#endif
         IFNET_WLOCK();
         TAILQ_FOREACH(iter, &V_ifnet, if_link)
                 if (iter == ifp) {



/bz



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