7aa62858bd3918dffc4169930d087a63dac129be
[openwrt/staging/aparcar.git] /
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Sat, 29 Sep 2018 15:55:44 +0200
3 Subject: [PATCH] mac80211: fix setting IEEE80211_KEY_FLAG_RX_MGMT for AP mode
4 keys
5
6 key->sta is only valid after ieee80211_key_link, which is called later
7 in this function. Because of that, the IEEE80211_KEY_FLAG_RX_MGMT is
8 never set when management frame protection is enabled.
9
10 Fixes: e548c49e6dc6b ("mac80211: add key flag for management keys")
11 Cc: stable@vger.kernel.org
12 Signed-off-by: Felix Fietkau <nbd@nbd.name>
13 ---
14
15 --- a/net/mac80211/cfg.c
16 +++ b/net/mac80211/cfg.c
17 @@ -427,7 +427,7 @@ static int ieee80211_add_key(struct wiph
18 case NL80211_IFTYPE_AP:
19 case NL80211_IFTYPE_AP_VLAN:
20 /* Keys without a station are used for TX only */
21 - if (key->sta && test_sta_flag(key->sta, WLAN_STA_MFP))
22 + if (sta && test_sta_flag(sta, WLAN_STA_MFP))
23 key->conf.flags |= IEEE80211_KEY_FLAG_RX_MGMT;
24 break;
25 case NL80211_IFTYPE_ADHOC: