334-mac80211-fix-wiphy-supported_band-access.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
  2. Date: Wed, 10 Feb 2016 16:08:17 +0100
  3. Subject: [PATCH] mac80211: fix wiphy supported_band access
  4. Fix wiphy supported_band access in tx radiotap parsing. In particular,
  5. info->band is always set to 0 (IEEE80211_BAND_2GHZ) since it has not
  6. assigned yet. This cause a kernel crash on 5GHz only devices.
  7. Move ieee80211_parse_tx_radiotap() after info->band assignment
  8. Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
  9. ---
  10. --- a/net/mac80211/tx.c
  11. +++ b/net/mac80211/tx.c
  12. @@ -1890,10 +1890,6 @@ netdev_tx_t ieee80211_monitor_start_xmit
  13. info->flags = IEEE80211_TX_CTL_REQ_TX_STATUS |
  14. IEEE80211_TX_CTL_INJECTED;
  15. - /* process and remove the injection radiotap header */
  16. - if (!ieee80211_parse_tx_radiotap(local, skb))
  17. - goto fail;
  18. -
  19. rcu_read_lock();
  20. /*
  21. @@ -1955,6 +1951,10 @@ netdev_tx_t ieee80211_monitor_start_xmit
  22. goto fail_rcu;
  23. info->band = chandef->chan->band;
  24. + /* process and remove the injection radiotap header */
  25. + if (!ieee80211_parse_tx_radiotap(local, skb))
  26. + goto fail_rcu;
  27. +
  28. ieee80211_xmit(sdata, NULL, skb);
  29. rcu_read_unlock();