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
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to