hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/net/wireless/sme.c
....@@ -5,7 +5,7 @@
55 * (for nl80211's connect() and wext)
66 *
77 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
8
- * Copyright (C) 2009 Intel Corporation. All rights reserved.
8
+ * Copyright (C) 2009, 2020 Intel Corporation. All rights reserved.
99 * Copyright 2017 Intel Deutschland GmbH
1010 */
1111
....@@ -24,7 +24,7 @@
2424
2525 /*
2626 * Software SME in cfg80211, using auth/assoc/deauth calls to the
27
- * driver. This is is for implementing nl80211's connect/disconnect
27
+ * driver. This is for implementing nl80211's connect/disconnect
2828 * and wireless extensions (if configured.)
2929 */
3030
....@@ -205,7 +205,7 @@
205205 return err;
206206 case CFG80211_CONN_ASSOC_FAILED_TIMEOUT:
207207 *treason = NL80211_TIMEOUT_ASSOC;
208
- /* fall through */
208
+ fallthrough;
209209 case CFG80211_CONN_ASSOC_FAILED:
210210 cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid,
211211 NULL, 0,
....@@ -215,7 +215,7 @@
215215 cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid,
216216 NULL, 0,
217217 WLAN_REASON_DEAUTH_LEAVING, false);
218
- /* fall through */
218
+ fallthrough;
219219 case CFG80211_CONN_ABANDON:
220220 /* free directly, disconnected event already sent */
221221 cfg80211_sme_free(wdev);
....@@ -694,6 +694,7 @@
694694 return;
695695 }
696696
697
+ wdev->unprot_beacon_reported = 0;
697698 nl80211_send_connect_result(wiphy_to_rdev(wdev->wiphy), dev, cr,
698699 GFP_KERNEL);
699700
....@@ -741,7 +742,7 @@
741742 }
742743
743744 if (cr->status != WLAN_STATUS_SUCCESS) {
744
- kzfree(wdev->connect_keys);
745
+ kfree_sensitive(wdev->connect_keys);
745746 wdev->connect_keys = NULL;
746747 wdev->ssid_len = 0;
747748 wdev->conn_owner_nlportid = 0;
....@@ -921,6 +922,7 @@
921922 cfg80211_hold_bss(bss_from_pub(info->bss));
922923 wdev->current_bss = bss_from_pub(info->bss);
923924
925
+ wdev->unprot_beacon_reported = 0;
924926 nl80211_send_roamed(wiphy_to_rdev(wdev->wiphy),
925927 wdev->netdev, info, GFP_KERNEL);
926928
....@@ -1096,7 +1098,7 @@
10961098 wdev->current_bss = NULL;
10971099 wdev->ssid_len = 0;
10981100 wdev->conn_owner_nlportid = 0;
1099
- kzfree(wdev->connect_keys);
1101
+ kfree_sensitive(wdev->connect_keys);
11001102 wdev->connect_keys = NULL;
11011103
11021104 nl80211_send_disconnected(rdev, dev, reason, ie, ie_len, from_ap);
....@@ -1116,7 +1118,10 @@
11161118
11171119 if (wiphy_ext_feature_isset(
11181120 wdev->wiphy,
1119
- NL80211_EXT_FEATURE_BEACON_PROTECTION))
1121
+ NL80211_EXT_FEATURE_BEACON_PROTECTION) ||
1122
+ wiphy_ext_feature_isset(
1123
+ wdev->wiphy,
1124
+ NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT))
11201125 max_key_idx = 7;
11211126 for (i = 0; i <= max_key_idx; i++)
11221127 rdev_del_key(rdev, dev, i, false, NULL);
....@@ -1206,6 +1211,8 @@
12061211
12071212 cfg80211_oper_and_ht_capa(&connect->ht_capa_mask,
12081213 rdev->wiphy.ht_capa_mod_mask);
1214
+ cfg80211_oper_and_vht_capa(&connect->vht_capa_mask,
1215
+ rdev->wiphy.vht_capa_mod_mask);
12091216
12101217 if (connkeys && connkeys->def >= 0) {
12111218 int idx;
....@@ -1274,7 +1281,7 @@
12741281
12751282 ASSERT_WDEV_LOCK(wdev);
12761283
1277
- kzfree(wdev->connect_keys);
1284
+ kfree_sensitive(wdev->connect_keys);
12781285 wdev->connect_keys = NULL;
12791286
12801287 wdev->conn_owner_nlportid = 0;