Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: fix wiphy supported_band access

Fix wiphy supported_band access in tx radiotap parsing introduced
in commit 5ec3aed9ba4c ("mac80211: Parse legacy and HT rate in
injected frames"). In particular, info->band is always set to 0
(IEEE80211_BAND_2GHZ) since it has not assigned yet.
This cause a kernel crash on 5GHz only devices.
Move ieee80211_parse_tx_radiotap() after info->band assignment

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Lorenzo Bianconi and committed by
Johannes Berg
109843b0 2b67f944

+5 -4
+5 -4
net/mac80211/tx.c
··· 1892 1892 info->flags = IEEE80211_TX_CTL_REQ_TX_STATUS | 1893 1893 IEEE80211_TX_CTL_INJECTED; 1894 1894 1895 - /* process and remove the injection radiotap header */ 1896 - if (!ieee80211_parse_tx_radiotap(local, skb)) 1897 - goto fail; 1898 - 1899 1895 rcu_read_lock(); 1900 1896 1901 1897 /* ··· 1953 1957 goto fail_rcu; 1954 1958 1955 1959 info->band = chandef->chan->band; 1960 + 1961 + /* process and remove the injection radiotap header */ 1962 + if (!ieee80211_parse_tx_radiotap(local, skb)) 1963 + goto fail_rcu; 1964 + 1956 1965 ieee80211_xmit(sdata, NULL, skb); 1957 1966 rcu_read_unlock(); 1958 1967