Author: avos
Date: Fri Feb 24 21:19:40 2017
New Revision: 314222
URL: https://svnweb.freebsd.org/changeset/base/314222

Log:
  MFC r313906:
  iwi, ral, zyd: fix possible use-after-free.

Modified:
  stable/11/sys/dev/iwi/if_iwi.c
  stable/11/sys/dev/ral/rt2661.c
  stable/11/sys/dev/usb/wlan/if_zyd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/iwi/if_iwi.c
==============================================================================
--- stable/11/sys/dev/iwi/if_iwi.c      Fri Feb 24 20:51:39 2017        
(r314221)
+++ stable/11/sys/dev/iwi/if_iwi.c      Fri Feb 24 21:19:40 2017        
(r314222)
@@ -1979,9 +1979,9 @@ iwi_start(struct iwi_softc *sc)
                }
                ni = (struct ieee80211_node *) m->m_pkthdr.rcvif;
                if (iwi_tx_start(sc, m, ni, ac) != 0) {
-                       ieee80211_free_node(ni);
                        if_inc_counter(ni->ni_vap->iv_ifp,
                            IFCOUNTER_OERRORS, 1);
+                       ieee80211_free_node(ni);
                        break;
                }
                sc->sc_tx_timer = 5;

Modified: stable/11/sys/dev/ral/rt2661.c
==============================================================================
--- stable/11/sys/dev/ral/rt2661.c      Fri Feb 24 20:51:39 2017        
(r314221)
+++ stable/11/sys/dev/ral/rt2661.c      Fri Feb 24 21:19:40 2017        
(r314222)
@@ -1619,9 +1619,9 @@ rt2661_start(struct rt2661_softc *sc)
                }
                ni = (struct ieee80211_node *) m->m_pkthdr.rcvif;
                if (rt2661_tx_data(sc, m, ni, ac) != 0) {
-                       ieee80211_free_node(ni);
                        if_inc_counter(ni->ni_vap->iv_ifp,
                            IFCOUNTER_OERRORS, 1);
+                       ieee80211_free_node(ni);
                        break;
                }
                sc->sc_tx_timer = 5;

Modified: stable/11/sys/dev/usb/wlan/if_zyd.c
==============================================================================
--- stable/11/sys/dev/usb/wlan/if_zyd.c Fri Feb 24 20:51:39 2017        
(r314221)
+++ stable/11/sys/dev/usb/wlan/if_zyd.c Fri Feb 24 21:19:40 2017        
(r314222)
@@ -2570,10 +2570,10 @@ zyd_start(struct zyd_softc *sc)
        while (sc->tx_nfree > 0 && (m = mbufq_dequeue(&sc->sc_snd)) != NULL) {
                ni = (struct ieee80211_node *)m->m_pkthdr.rcvif;
                if (zyd_tx_start(sc, m, ni) != 0) {
-                       ieee80211_free_node(ni);
                        m_freem(m);
                        if_inc_counter(ni->ni_vap->iv_ifp,
                            IFCOUNTER_OERRORS, 1);
+                       ieee80211_free_node(ni);
                        break;
                }
        }
_______________________________________________
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