Skip to content

Commit 9047696

Browse files
nbd168gregkh
authored andcommitted
mac80211: fix setting IEEE80211_KEY_FLAG_RX_MGMT for AP mode keys
commit 211710c upstream. 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: e548c49 ("mac80211: add key flag for management keys") Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8ebd655 commit 9047696

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/mac80211/cfg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
426426
case NL80211_IFTYPE_AP:
427427
case NL80211_IFTYPE_AP_VLAN:
428428
/* Keys without a station are used for TX only */
429-
if (key->sta && test_sta_flag(key->sta, WLAN_STA_MFP))
429+
if (sta && test_sta_flag(sta, WLAN_STA_MFP))
430430
key->conf.flags |= IEEE80211_KEY_FLAG_RX_MGMT;
431431
break;
432432
case NL80211_IFTYPE_ADHOC:

0 commit comments

Comments
 (0)