svn commit: r302054 - in head/sys: contrib/ipfilter/netinet dev/usb/net kern net netgraph netinet netinet6 netipsec netpfil/ipfw netpfil/pf

Bjoern A. Zeeb bz at FreeBSD.org
Wed Jun 22 10:32:35 UTC 2016


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


More information about the svn-src-all mailing list