Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jan 2019 07:50:23 +0000 (UTC)
From:      Andriy Voskoboinyk <avos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r343018 - stable/12/sys/net80211
Message-ID:  <201901140750.x0E7oNqE075491@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avos
Date: Mon Jan 14 07:50:23 2019
New Revision: 343018
URL: https://svnweb.freebsd.org/changeset/base/343018

Log:
  MFC r342883:
  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).

Modified:
  stable/12/sys/net80211/ieee80211_ioctl.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/net80211/ieee80211_ioctl.c
==============================================================================
--- stable/12/sys/net80211/ieee80211_ioctl.c	Mon Jan 14 07:31:19 2019	(r343017)
+++ stable/12/sys/net80211/ieee80211_ioctl.c	Mon Jan 14 07:50:23 2019	(r343018)
@@ -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));



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