Skip to contentSkip to conversation

mac80211: fix setting IEEE80211_KEY_FLAG_RX_MGMT for AP mode keys

PATCH New Felix Fietkau 1 participant 1 message Sep 29, 2018 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: fix setting IEEE80211_KEY_FLAG_RX_MGMT for AP mode keys

key->sta is only valid after ieee80211_key_link, which is called later in this function. Because of that, the IEEE80211_KEY_FLAG_RX_MGMT is never set when management frame protection is enabled.

Fixes e548c49e6dc6b ("mac80211: add key flag for management keys")
---
 net/mac80211/cfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/cfg.c +1 -1
index 504627e2117f..914aef7e7afd 100644
@@ -425,7 +425,7 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
 	case NL80211_IFTYPE_AP:
 	case NL80211_IFTYPE_AP_VLAN:
 		/* Keys without a station are used for TX only */
-		if (key->sta && test_sta_flag(key->sta, WLAN_STA_MFP))
+		if (sta && test_sta_flag(sta, WLAN_STA_MFP))
 			key->conf.flags |= IEEE80211_KEY_FLAG_RX_MGMT;
 		break;
 	case NL80211_IFTYPE_ADHOC:
Signature · 1 line
2.17.0