rpcd: iwinfo plugin fixes
[openwrt.git] / package / kernel / mac80211 / patches / 334-mac80211-fix-wiphy-supported_band-access.patch
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
5 Fix wiphy supported_band access in tx radiotap parsing. In particular,
6 info->band is always set to 0 (IEEE80211_BAND_2GHZ) since it has not
7 assigned yet. This cause a kernel crash on 5GHz only devices.
8 Move ieee80211_parse_tx_radiotap() after info->band assignment
9
10 Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
11 ---
12
13 --- a/net/mac80211/tx.c
14 +++ b/net/mac80211/tx.c
15 @@ -1890,10 +1890,6 @@ netdev_tx_t ieee80211_monitor_start_xmit
16         info->flags = IEEE80211_TX_CTL_REQ_TX_STATUS |
17                       IEEE80211_TX_CTL_INJECTED;
18  
19 -       /* process and remove the injection radiotap header */
20 -       if (!ieee80211_parse_tx_radiotap(local, skb))
21 -               goto fail;
22 -
23         rcu_read_lock();
24  
25         /*
26 @@ -1955,6 +1951,10 @@ netdev_tx_t ieee80211_monitor_start_xmit
27                 goto fail_rcu;
28  
29         info->band = chandef->chan->band;
30 +       /* process and remove the injection radiotap header */
31 +       if (!ieee80211_parse_tx_radiotap(local, skb))
32 +               goto fail_rcu;
33 +
34         ieee80211_xmit(sdata, NULL, skb);
35         rcu_read_unlock();
36