Author: avos
Date: Wed Jan  9 12:50:24 2019
New Revision: 342883
URL: https://svnweb.freebsd.org/changeset/base/342883

Log:
  net80211: fix panic when device is removed during initialization
  
  if_dead() is called during device detach - check if interface is
  still exists before trying to refresh vap MAC address
  (IF_LLADDR will trigger page fault otherwise).
  
  MFC after:    5 days

Modified:
  head/sys/net80211/ieee80211_ioctl.c

Modified: head/sys/net80211/ieee80211_ioctl.c
==============================================================================
--- head/sys/net80211/ieee80211_ioctl.c Wed Jan  9 11:13:05 2019        
(r342882)
+++ head/sys/net80211/ieee80211_ioctl.c Wed Jan  9 12:50:24 2019        
(r342883)
@@ -3537,9 +3537,13 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t
                        /*
                         * Check if the MAC address was changed
                         * via SIOCSIFLLADDR ioctl.
+                        *
+                        * NB: device may be detached during initialization;
+                        * use if_ioctl for existence check.
                         */
                        if_addr_rlock(ifp);
-                       if ((ifp->if_flags & IFF_UP) == 0 &&
+                       if (ifp->if_ioctl == ieee80211_ioctl &&
+                           (ifp->if_flags & IFF_UP) == 0 &&
                            !IEEE80211_ADDR_EQ(vap->iv_myaddr, IF_LLADDR(ifp)))
                                IEEE80211_ADDR_COPY(vap->iv_myaddr,
                                    IF_LLADDR(ifp));
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to