diff options
author | David S. Miller <davem@davemloft.net> | 2019-06-14 12:36:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-14 12:36:51 -0400 |
commit | 2a2af5e6e6f55e8ec381f710b8765ffe2838e313 (patch) | |
tree | 743a182912d7bb35ecc6b67e7323d3dd25869f3a | |
parent | 4add700968c7761acba88e70a0aa3f44e5ad359d (diff) | |
parent | b65842025335711e2a0259feb4dbadb0c9ffb6d9 (diff) |
Merge tag 'mac80211-for-davem-2019-06-14' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
Johannes Berg says:
====================
Various fixes, all over:
* a few memory leaks
* fixes for management frame protection security
and A2/A3 confusion (affecting TDLS as well)
* build fix for certificates
* etc.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 1 | ||||
-rw-r--r-- | include/net/cfg80211.h | 3 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 12 | ||||
-rw-r--r-- | net/mac80211/key.c | 2 | ||||
-rw-r--r-- | net/mac80211/mesh.c | 6 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 12 | ||||
-rw-r--r-- | net/mac80211/rx.c | 2 | ||||
-rw-r--r-- | net/mac80211/tdls.c | 23 | ||||
-rw-r--r-- | net/mac80211/util.c | 8 | ||||
-rw-r--r-- | net/mac80211/wpa.c | 7 | ||||
-rw-r--r-- | net/wireless/Makefile | 1 | ||||
-rw-r--r-- | net/wireless/core.c | 8 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 99 | ||||
-rw-r--r-- | net/wireless/pmsr.c | 4 | ||||
-rw-r--r-- | net/wireless/scan.c | 4 | ||||
-rw-r--r-- | net/wireless/util.c | 4 |
16 files changed, 156 insertions, 40 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 60ca13e0f15b..b5274d1f30fa 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
@@ -3851,6 +3851,7 @@ static int __init init_mac80211_hwsim(void) | |||
3851 | break; | 3851 | break; |
3852 | case HWSIM_REGTEST_STRICT_ALL: | 3852 | case HWSIM_REGTEST_STRICT_ALL: |
3853 | param.reg_strict = true; | 3853 | param.reg_strict = true; |
3854 | /* fall through */ | ||
3854 | case HWSIM_REGTEST_DRIVER_REG_ALL: | 3855 | case HWSIM_REGTEST_DRIVER_REG_ALL: |
3855 | param.reg_alpha2 = hwsim_alpha2s[0]; | 3856 | param.reg_alpha2 = hwsim_alpha2s[0]; |
3856 | break; | 3857 | break; |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 87dae868707e..948139690a58 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -3839,7 +3839,8 @@ struct cfg80211_ops { | |||
3839 | * on wiphy_new(), but can be changed by the driver if it has a good | 3839 | * on wiphy_new(), but can be changed by the driver if it has a good |
3840 | * reason to override the default | 3840 | * reason to override the default |
3841 | * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station | 3841 | * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station |
3842 | * on a VLAN interface) | 3842 | * on a VLAN interface). This flag also serves an extra purpose of |
3843 | * supporting 4ADDR AP mode on devices which do not support AP/VLAN iftype. | ||
3843 | * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station | 3844 | * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station |
3844 | * @WIPHY_FLAG_CONTROL_PORT_PROTOCOL: This device supports setting the | 3845 | * @WIPHY_FLAG_CONTROL_PORT_PROTOCOL: This device supports setting the |
3845 | * control port protocol ethertype. The device also honours the | 3846 | * control port protocol ethertype. The device also honours the |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 073a8235ae1b..a86fcae279a6 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -1435,7 +1435,7 @@ ieee80211_get_sband(struct ieee80211_sub_if_data *sdata) | |||
1435 | rcu_read_lock(); | 1435 | rcu_read_lock(); |
1436 | chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); | 1436 | chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); |
1437 | 1437 | ||
1438 | if (WARN_ON(!chanctx_conf)) { | 1438 | if (WARN_ON_ONCE(!chanctx_conf)) { |
1439 | rcu_read_unlock(); | 1439 | rcu_read_unlock(); |
1440 | return NULL; | 1440 | return NULL; |
1441 | } | 1441 | } |
@@ -2038,6 +2038,13 @@ void __ieee80211_flush_queues(struct ieee80211_local *local, | |||
2038 | static inline bool ieee80211_can_run_worker(struct ieee80211_local *local) | 2038 | static inline bool ieee80211_can_run_worker(struct ieee80211_local *local) |
2039 | { | 2039 | { |
2040 | /* | 2040 | /* |
2041 | * It's unsafe to try to do any work during reconfigure flow. | ||
2042 | * When the flow ends the work will be requeued. | ||
2043 | */ | ||
2044 | if (local->in_reconfig) | ||
2045 | return false; | ||
2046 | |||
2047 | /* | ||
2041 | * If quiescing is set, we are racing with __ieee80211_suspend. | 2048 | * If quiescing is set, we are racing with __ieee80211_suspend. |
2042 | * __ieee80211_suspend flushes the workers after setting quiescing, | 2049 | * __ieee80211_suspend flushes the workers after setting quiescing, |
2043 | * and we check quiescing / suspended before enqueing new workers. | 2050 | * and we check quiescing / suspended before enqueing new workers. |
@@ -2225,6 +2232,9 @@ void ieee80211_tdls_cancel_channel_switch(struct wiphy *wiphy, | |||
2225 | const u8 *addr); | 2232 | const u8 *addr); |
2226 | void ieee80211_teardown_tdls_peers(struct ieee80211_sub_if_data *sdata); | 2233 | void ieee80211_teardown_tdls_peers(struct ieee80211_sub_if_data *sdata); |
2227 | void ieee80211_tdls_chsw_work(struct work_struct *wk); | 2234 | void ieee80211_tdls_chsw_work(struct work_struct *wk); |
2235 | void ieee80211_tdls_handle_disconnect(struct ieee80211_sub_if_data *sdata, | ||
2236 | const u8 *peer, u16 reason); | ||
2237 | const char *ieee80211_get_reason_code_string(u16 reason_code); | ||
2228 | 2238 | ||
2229 | extern const struct ethtool_ops ieee80211_ethtool_ops; | 2239 | extern const struct ethtool_ops ieee80211_ethtool_ops; |
2230 | 2240 | ||
diff --git a/net/mac80211/key.c b/net/mac80211/key.c index 20bf9db7a388..89f09a09efdb 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c | |||
@@ -268,11 +268,9 @@ int ieee80211_set_tx_key(struct ieee80211_key *key) | |||
268 | { | 268 | { |
269 | struct sta_info *sta = key->sta; | 269 | struct sta_info *sta = key->sta; |
270 | struct ieee80211_local *local = key->local; | 270 | struct ieee80211_local *local = key->local; |
271 | struct ieee80211_key *old; | ||
272 | 271 | ||
273 | assert_key_lock(local); | 272 | assert_key_lock(local); |
274 | 273 | ||
275 | old = key_mtx_dereference(local, sta->ptk[sta->ptk_idx]); | ||
276 | sta->ptk_idx = key->conf.keyidx; | 274 | sta->ptk_idx = key->conf.keyidx; |
277 | ieee80211_check_fast_xmit(sta); | 275 | ieee80211_check_fast_xmit(sta); |
278 | 276 | ||
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 766e5e5bab8a..fe44f0d98de0 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
@@ -929,6 +929,7 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata) | |||
929 | 929 | ||
930 | /* flush STAs and mpaths on this iface */ | 930 | /* flush STAs and mpaths on this iface */ |
931 | sta_info_flush(sdata); | 931 | sta_info_flush(sdata); |
932 | ieee80211_free_keys(sdata, true); | ||
932 | mesh_path_flush_by_iface(sdata); | 933 | mesh_path_flush_by_iface(sdata); |
933 | 934 | ||
934 | /* stop the beacon */ | 935 | /* stop the beacon */ |
@@ -1220,7 +1221,8 @@ int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata) | |||
1220 | ifmsh->chsw_ttl = 0; | 1221 | ifmsh->chsw_ttl = 0; |
1221 | 1222 | ||
1222 | /* Remove the CSA and MCSP elements from the beacon */ | 1223 | /* Remove the CSA and MCSP elements from the beacon */ |
1223 | tmp_csa_settings = rcu_dereference(ifmsh->csa); | 1224 | tmp_csa_settings = rcu_dereference_protected(ifmsh->csa, |
1225 | lockdep_is_held(&sdata->wdev.mtx)); | ||
1224 | RCU_INIT_POINTER(ifmsh->csa, NULL); | 1226 | RCU_INIT_POINTER(ifmsh->csa, NULL); |
1225 | if (tmp_csa_settings) | 1227 | if (tmp_csa_settings) |
1226 | kfree_rcu(tmp_csa_settings, rcu_head); | 1228 | kfree_rcu(tmp_csa_settings, rcu_head); |
@@ -1242,6 +1244,8 @@ int ieee80211_mesh_csa_beacon(struct ieee80211_sub_if_data *sdata, | |||
1242 | struct mesh_csa_settings *tmp_csa_settings; | 1244 | struct mesh_csa_settings *tmp_csa_settings; |
1243 | int ret = 0; | 1245 | int ret = 0; |
1244 | 1246 | ||
1247 | lockdep_assert_held(&sdata->wdev.mtx); | ||
1248 | |||
1245 | tmp_csa_settings = kmalloc(sizeof(*tmp_csa_settings), | 1249 | tmp_csa_settings = kmalloc(sizeof(*tmp_csa_settings), |
1246 | GFP_ATOMIC); | 1250 | GFP_ATOMIC); |
1247 | if (!tmp_csa_settings) | 1251 | if (!tmp_csa_settings) |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index b7a9fe3d5fcb..383b0df100e4 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -2963,7 +2963,7 @@ static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata, | |||
2963 | #define case_WLAN(type) \ | 2963 | #define case_WLAN(type) \ |
2964 | case WLAN_REASON_##type: return #type | 2964 | case WLAN_REASON_##type: return #type |
2965 | 2965 | ||
2966 | static const char *ieee80211_get_reason_code_string(u16 reason_code) | 2966 | const char *ieee80211_get_reason_code_string(u16 reason_code) |
2967 | { | 2967 | { |
2968 | switch (reason_code) { | 2968 | switch (reason_code) { |
2969 | case_WLAN(UNSPECIFIED); | 2969 | case_WLAN(UNSPECIFIED); |
@@ -3028,6 +3028,11 @@ static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata, | |||
3028 | if (len < 24 + 2) | 3028 | if (len < 24 + 2) |
3029 | return; | 3029 | return; |
3030 | 3030 | ||
3031 | if (!ether_addr_equal(mgmt->bssid, mgmt->sa)) { | ||
3032 | ieee80211_tdls_handle_disconnect(sdata, mgmt->sa, reason_code); | ||
3033 | return; | ||
3034 | } | ||
3035 | |||
3031 | if (ifmgd->associated && | 3036 | if (ifmgd->associated && |
3032 | ether_addr_equal(mgmt->bssid, ifmgd->associated->bssid)) { | 3037 | ether_addr_equal(mgmt->bssid, ifmgd->associated->bssid)) { |
3033 | const u8 *bssid = ifmgd->associated->bssid; | 3038 | const u8 *bssid = ifmgd->associated->bssid; |
@@ -3077,6 +3082,11 @@ static void ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata, | |||
3077 | 3082 | ||
3078 | reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code); | 3083 | reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code); |
3079 | 3084 | ||
3085 | if (!ether_addr_equal(mgmt->bssid, mgmt->sa)) { | ||
3086 | ieee80211_tdls_handle_disconnect(sdata, mgmt->sa, reason_code); | ||
3087 | return; | ||
3088 | } | ||
3089 | |||
3080 | sdata_info(sdata, "disassociated from %pM (Reason: %u=%s)\n", | 3090 | sdata_info(sdata, "disassociated from %pM (Reason: %u=%s)\n", |
3081 | mgmt->sa, reason_code, | 3091 | mgmt->sa, reason_code, |
3082 | ieee80211_get_reason_code_string(reason_code)); | 3092 | ieee80211_get_reason_code_string(reason_code)); |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 25577ede2986..fd3740000e87 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -3831,6 +3831,8 @@ static bool ieee80211_accept_frame(struct ieee80211_rx_data *rx) | |||
3831 | case NL80211_IFTYPE_STATION: | 3831 | case NL80211_IFTYPE_STATION: |
3832 | if (!bssid && !sdata->u.mgd.use_4addr) | 3832 | if (!bssid && !sdata->u.mgd.use_4addr) |
3833 | return false; | 3833 | return false; |
3834 | if (ieee80211_is_robust_mgmt_frame(skb) && !rx->sta) | ||
3835 | return false; | ||
3834 | if (multicast) | 3836 | if (multicast) |
3835 | return true; | 3837 | return true; |
3836 | return ether_addr_equal(sdata->vif.addr, hdr->addr1); | 3838 | return ether_addr_equal(sdata->vif.addr, hdr->addr1); |
diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c index 24c37f91ca46..ba8fe48952d9 100644 --- a/net/mac80211/tdls.c +++ b/net/mac80211/tdls.c | |||
@@ -1994,3 +1994,26 @@ void ieee80211_tdls_chsw_work(struct work_struct *wk) | |||
1994 | } | 1994 | } |
1995 | rtnl_unlock(); | 1995 | rtnl_unlock(); |
1996 | } | 1996 | } |
1997 | |||
1998 | void ieee80211_tdls_handle_disconnect(struct ieee80211_sub_if_data *sdata, | ||
1999 | const u8 *peer, u16 reason) | ||
2000 | { | ||
2001 | struct ieee80211_sta *sta; | ||
2002 | |||
2003 | rcu_read_lock(); | ||
2004 | sta = ieee80211_find_sta(&sdata->vif, peer); | ||
2005 | if (!sta || !sta->tdls) { | ||
2006 | rcu_read_unlock(); | ||
2007 | return; | ||
2008 | } | ||
2009 | rcu_read_unlock(); | ||
2010 | |||
2011 | tdls_dbg(sdata, "disconnected from TDLS peer %pM (Reason: %u=%s)\n", | ||
2012 | peer, reason, | ||
2013 | ieee80211_get_reason_code_string(reason)); | ||
2014 | |||
2015 | ieee80211_tdls_oper_request(&sdata->vif, peer, | ||
2016 | NL80211_TDLS_TEARDOWN, | ||
2017 | WLAN_REASON_TDLS_TEARDOWN_UNREACHABLE, | ||
2018 | GFP_ATOMIC); | ||
2019 | } | ||
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index cba4633cd6cf..e2edc2a3cc8b 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -2480,6 +2480,10 @@ int ieee80211_reconfig(struct ieee80211_local *local) | |||
2480 | mutex_lock(&local->mtx); | 2480 | mutex_lock(&local->mtx); |
2481 | ieee80211_start_next_roc(local); | 2481 | ieee80211_start_next_roc(local); |
2482 | mutex_unlock(&local->mtx); | 2482 | mutex_unlock(&local->mtx); |
2483 | |||
2484 | /* Requeue all works */ | ||
2485 | list_for_each_entry(sdata, &local->interfaces, list) | ||
2486 | ieee80211_queue_work(&local->hw, &sdata->work); | ||
2483 | } | 2487 | } |
2484 | 2488 | ||
2485 | ieee80211_wake_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP, | 2489 | ieee80211_wake_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP, |
@@ -3795,7 +3799,9 @@ int ieee80211_check_combinations(struct ieee80211_sub_if_data *sdata, | |||
3795 | } | 3799 | } |
3796 | 3800 | ||
3797 | /* Always allow software iftypes */ | 3801 | /* Always allow software iftypes */ |
3798 | if (local->hw.wiphy->software_iftypes & BIT(iftype)) { | 3802 | if (local->hw.wiphy->software_iftypes & BIT(iftype) || |
3803 | (iftype == NL80211_IFTYPE_AP_VLAN && | ||
3804 | local->hw.wiphy->flags & WIPHY_FLAG_4ADDR_AP)) { | ||
3799 | if (radar_detect) | 3805 | if (radar_detect) |
3800 | return -EINVAL; | 3806 | return -EINVAL; |
3801 | return 0; | 3807 | return 0; |
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index 58d0b258b684..5dd48f0a4b1b 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
@@ -1175,7 +1175,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct ieee80211_rx_data *rx) | |||
1175 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); | 1175 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); |
1176 | struct ieee80211_key *key = rx->key; | 1176 | struct ieee80211_key *key = rx->key; |
1177 | struct ieee80211_mmie_16 *mmie; | 1177 | struct ieee80211_mmie_16 *mmie; |
1178 | u8 aad[GMAC_AAD_LEN], mic[GMAC_MIC_LEN], ipn[6], nonce[GMAC_NONCE_LEN]; | 1178 | u8 aad[GMAC_AAD_LEN], *mic, ipn[6], nonce[GMAC_NONCE_LEN]; |
1179 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 1179 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
1180 | 1180 | ||
1181 | if (!ieee80211_is_mgmt(hdr->frame_control)) | 1181 | if (!ieee80211_is_mgmt(hdr->frame_control)) |
@@ -1206,13 +1206,18 @@ ieee80211_crypto_aes_gmac_decrypt(struct ieee80211_rx_data *rx) | |||
1206 | memcpy(nonce, hdr->addr2, ETH_ALEN); | 1206 | memcpy(nonce, hdr->addr2, ETH_ALEN); |
1207 | memcpy(nonce + ETH_ALEN, ipn, 6); | 1207 | memcpy(nonce + ETH_ALEN, ipn, 6); |
1208 | 1208 | ||
1209 | mic = kmalloc(GMAC_MIC_LEN, GFP_ATOMIC); | ||
1210 | if (!mic) | ||
1211 | return RX_DROP_UNUSABLE; | ||
1209 | if (ieee80211_aes_gmac(key->u.aes_gmac.tfm, aad, nonce, | 1212 | if (ieee80211_aes_gmac(key->u.aes_gmac.tfm, aad, nonce, |
1210 | skb->data + 24, skb->len - 24, | 1213 | skb->data + 24, skb->len - 24, |
1211 | mic) < 0 || | 1214 | mic) < 0 || |
1212 | crypto_memneq(mic, mmie->mic, sizeof(mmie->mic))) { | 1215 | crypto_memneq(mic, mmie->mic, sizeof(mmie->mic))) { |
1213 | key->u.aes_gmac.icverrors++; | 1216 | key->u.aes_gmac.icverrors++; |
1217 | kfree(mic); | ||
1214 | return RX_DROP_UNUSABLE; | 1218 | return RX_DROP_UNUSABLE; |
1215 | } | 1219 | } |
1220 | kfree(mic); | ||
1216 | } | 1221 | } |
1217 | 1222 | ||
1218 | memcpy(key->u.aes_gmac.rx_pn, ipn, 6); | 1223 | memcpy(key->u.aes_gmac.rx_pn, ipn, 6); |
diff --git a/net/wireless/Makefile b/net/wireless/Makefile index 72a224ce8e0a..2eee93985ab0 100644 --- a/net/wireless/Makefile +++ b/net/wireless/Makefile | |||
@@ -39,6 +39,7 @@ $(obj)/extra-certs.c: $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR:"%"=%) \ | |||
39 | @(set -e; \ | 39 | @(set -e; \ |
40 | allf=""; \ | 40 | allf=""; \ |
41 | for f in $^ ; do \ | 41 | for f in $^ ; do \ |
42 | test -f $$f || continue;\ | ||
42 | # similar to hexdump -v -e '1/1 "0x%.2x," "\n"' \ | 43 | # similar to hexdump -v -e '1/1 "0x%.2x," "\n"' \ |
43 | thisf=$$(od -An -v -tx1 < $$f | \ | 44 | thisf=$$(od -An -v -tx1 < $$f | \ |
44 | sed -e 's/ /\n/g' | \ | 45 | sed -e 's/ /\n/g' | \ |
diff --git a/net/wireless/core.c b/net/wireless/core.c index 037816163e70..53ad3dbb76fe 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -514,7 +514,7 @@ use_default_name: | |||
514 | &rdev->rfkill_ops, rdev); | 514 | &rdev->rfkill_ops, rdev); |
515 | 515 | ||
516 | if (!rdev->rfkill) { | 516 | if (!rdev->rfkill) { |
517 | kfree(rdev); | 517 | wiphy_free(&rdev->wiphy); |
518 | return NULL; | 518 | return NULL; |
519 | } | 519 | } |
520 | 520 | ||
@@ -1397,8 +1397,12 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, | |||
1397 | } | 1397 | } |
1398 | break; | 1398 | break; |
1399 | case NETDEV_PRE_UP: | 1399 | case NETDEV_PRE_UP: |
1400 | if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype))) | 1400 | if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)) && |
1401 | !(wdev->iftype == NL80211_IFTYPE_AP_VLAN && | ||
1402 | rdev->wiphy.flags & WIPHY_FLAG_4ADDR_AP && | ||
1403 | wdev->use_4addr)) | ||
1401 | return notifier_from_errno(-EOPNOTSUPP); | 1404 | return notifier_from_errno(-EOPNOTSUPP); |
1405 | |||
1402 | if (rfkill_blocked(rdev->rfkill)) | 1406 | if (rfkill_blocked(rdev->rfkill)) |
1403 | return notifier_from_errno(-ERFKILL); | 1407 | return notifier_from_errno(-ERFKILL); |
1404 | break; | 1408 | break; |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index c391b560d986..520d437aa8d1 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -304,8 +304,11 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | |||
304 | [NL80211_ATTR_IFINDEX] = { .type = NLA_U32 }, | 304 | [NL80211_ATTR_IFINDEX] = { .type = NLA_U32 }, |
305 | [NL80211_ATTR_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ-1 }, | 305 | [NL80211_ATTR_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ-1 }, |
306 | 306 | ||
307 | [NL80211_ATTR_MAC] = { .len = ETH_ALEN }, | 307 | [NL80211_ATTR_MAC] = { .type = NLA_EXACT_LEN_WARN, .len = ETH_ALEN }, |
308 | [NL80211_ATTR_PREV_BSSID] = { .len = ETH_ALEN }, | 308 | [NL80211_ATTR_PREV_BSSID] = { |
309 | .type = NLA_EXACT_LEN_WARN, | ||
310 | .len = ETH_ALEN | ||
311 | }, | ||
309 | 312 | ||
310 | [NL80211_ATTR_KEY] = { .type = NLA_NESTED, }, | 313 | [NL80211_ATTR_KEY] = { .type = NLA_NESTED, }, |
311 | [NL80211_ATTR_KEY_DATA] = { .type = NLA_BINARY, | 314 | [NL80211_ATTR_KEY_DATA] = { .type = NLA_BINARY, |
@@ -356,7 +359,10 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | |||
356 | [NL80211_ATTR_MESH_CONFIG] = { .type = NLA_NESTED }, | 359 | [NL80211_ATTR_MESH_CONFIG] = { .type = NLA_NESTED }, |
357 | [NL80211_ATTR_SUPPORT_MESH_AUTH] = { .type = NLA_FLAG }, | 360 | [NL80211_ATTR_SUPPORT_MESH_AUTH] = { .type = NLA_FLAG }, |
358 | 361 | ||
359 | [NL80211_ATTR_HT_CAPABILITY] = { .len = NL80211_HT_CAPABILITY_LEN }, | 362 | [NL80211_ATTR_HT_CAPABILITY] = { |
363 | .type = NLA_EXACT_LEN_WARN, | ||
364 | .len = NL80211_HT_CAPABILITY_LEN | ||
365 | }, | ||
360 | 366 | ||
361 | [NL80211_ATTR_MGMT_SUBTYPE] = { .type = NLA_U8 }, | 367 | [NL80211_ATTR_MGMT_SUBTYPE] = { .type = NLA_U8 }, |
362 | [NL80211_ATTR_IE] = NLA_POLICY_VALIDATE_FN(NLA_BINARY, | 368 | [NL80211_ATTR_IE] = NLA_POLICY_VALIDATE_FN(NLA_BINARY, |
@@ -386,7 +392,10 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | |||
386 | [NL80211_ATTR_WPA_VERSIONS] = { .type = NLA_U32 }, | 392 | [NL80211_ATTR_WPA_VERSIONS] = { .type = NLA_U32 }, |
387 | [NL80211_ATTR_PID] = { .type = NLA_U32 }, | 393 | [NL80211_ATTR_PID] = { .type = NLA_U32 }, |
388 | [NL80211_ATTR_4ADDR] = { .type = NLA_U8 }, | 394 | [NL80211_ATTR_4ADDR] = { .type = NLA_U8 }, |
389 | [NL80211_ATTR_PMKID] = { .len = WLAN_PMKID_LEN }, | 395 | [NL80211_ATTR_PMKID] = { |
396 | .type = NLA_EXACT_LEN_WARN, | ||
397 | .len = WLAN_PMKID_LEN | ||
398 | }, | ||
390 | [NL80211_ATTR_DURATION] = { .type = NLA_U32 }, | 399 | [NL80211_ATTR_DURATION] = { .type = NLA_U32 }, |
391 | [NL80211_ATTR_COOKIE] = { .type = NLA_U64 }, | 400 | [NL80211_ATTR_COOKIE] = { .type = NLA_U64 }, |
392 | [NL80211_ATTR_TX_RATES] = { .type = NLA_NESTED }, | 401 | [NL80211_ATTR_TX_RATES] = { .type = NLA_NESTED }, |
@@ -448,7 +457,10 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | |||
448 | [NL80211_ATTR_WDEV] = { .type = NLA_U64 }, | 457 | [NL80211_ATTR_WDEV] = { .type = NLA_U64 }, |
449 | [NL80211_ATTR_USER_REG_HINT_TYPE] = { .type = NLA_U32 }, | 458 | [NL80211_ATTR_USER_REG_HINT_TYPE] = { .type = NLA_U32 }, |
450 | [NL80211_ATTR_AUTH_DATA] = { .type = NLA_BINARY, }, | 459 | [NL80211_ATTR_AUTH_DATA] = { .type = NLA_BINARY, }, |
451 | [NL80211_ATTR_VHT_CAPABILITY] = { .len = NL80211_VHT_CAPABILITY_LEN }, | 460 | [NL80211_ATTR_VHT_CAPABILITY] = { |
461 | .type = NLA_EXACT_LEN_WARN, | ||
462 | .len = NL80211_VHT_CAPABILITY_LEN | ||
463 | }, | ||
452 | [NL80211_ATTR_SCAN_FLAGS] = { .type = NLA_U32 }, | 464 | [NL80211_ATTR_SCAN_FLAGS] = { .type = NLA_U32 }, |
453 | [NL80211_ATTR_P2P_CTWINDOW] = NLA_POLICY_MAX(NLA_U8, 127), | 465 | [NL80211_ATTR_P2P_CTWINDOW] = NLA_POLICY_MAX(NLA_U8, 127), |
454 | [NL80211_ATTR_P2P_OPPPS] = NLA_POLICY_MAX(NLA_U8, 1), | 466 | [NL80211_ATTR_P2P_OPPPS] = NLA_POLICY_MAX(NLA_U8, 1), |
@@ -484,7 +496,10 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | |||
484 | [NL80211_ATTR_VENDOR_DATA] = { .type = NLA_BINARY }, | 496 | [NL80211_ATTR_VENDOR_DATA] = { .type = NLA_BINARY }, |
485 | [NL80211_ATTR_QOS_MAP] = { .type = NLA_BINARY, | 497 | [NL80211_ATTR_QOS_MAP] = { .type = NLA_BINARY, |
486 | .len = IEEE80211_QOS_MAP_LEN_MAX }, | 498 | .len = IEEE80211_QOS_MAP_LEN_MAX }, |
487 | [NL80211_ATTR_MAC_HINT] = { .len = ETH_ALEN }, | 499 | [NL80211_ATTR_MAC_HINT] = { |
500 | .type = NLA_EXACT_LEN_WARN, | ||
501 | .len = ETH_ALEN | ||
502 | }, | ||
488 | [NL80211_ATTR_WIPHY_FREQ_HINT] = { .type = NLA_U32 }, | 503 | [NL80211_ATTR_WIPHY_FREQ_HINT] = { .type = NLA_U32 }, |
489 | [NL80211_ATTR_TDLS_PEER_CAPABILITY] = { .type = NLA_U32 }, | 504 | [NL80211_ATTR_TDLS_PEER_CAPABILITY] = { .type = NLA_U32 }, |
490 | [NL80211_ATTR_SOCKET_OWNER] = { .type = NLA_FLAG }, | 505 | [NL80211_ATTR_SOCKET_OWNER] = { .type = NLA_FLAG }, |
@@ -495,7 +510,10 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | |||
495 | NLA_POLICY_MAX(NLA_U8, IEEE80211_NUM_UPS - 1), | 510 | NLA_POLICY_MAX(NLA_U8, IEEE80211_NUM_UPS - 1), |
496 | [NL80211_ATTR_ADMITTED_TIME] = { .type = NLA_U16 }, | 511 | [NL80211_ATTR_ADMITTED_TIME] = { .type = NLA_U16 }, |
497 | [NL80211_ATTR_SMPS_MODE] = { .type = NLA_U8 }, | 512 | [NL80211_ATTR_SMPS_MODE] = { .type = NLA_U8 }, |
498 | [NL80211_ATTR_MAC_MASK] = { .len = ETH_ALEN }, | 513 | [NL80211_ATTR_MAC_MASK] = { |
514 | .type = NLA_EXACT_LEN_WARN, | ||
515 | .len = ETH_ALEN | ||
516 | }, | ||
499 | [NL80211_ATTR_WIPHY_SELF_MANAGED_REG] = { .type = NLA_FLAG }, | 517 | [NL80211_ATTR_WIPHY_SELF_MANAGED_REG] = { .type = NLA_FLAG }, |
500 | [NL80211_ATTR_NETNS_FD] = { .type = NLA_U32 }, | 518 | [NL80211_ATTR_NETNS_FD] = { .type = NLA_U32 }, |
501 | [NL80211_ATTR_SCHED_SCAN_DELAY] = { .type = NLA_U32 }, | 519 | [NL80211_ATTR_SCHED_SCAN_DELAY] = { .type = NLA_U32 }, |
@@ -507,15 +525,21 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | |||
507 | [NL80211_ATTR_MU_MIMO_GROUP_DATA] = { | 525 | [NL80211_ATTR_MU_MIMO_GROUP_DATA] = { |
508 | .len = VHT_MUMIMO_GROUPS_DATA_LEN | 526 | .len = VHT_MUMIMO_GROUPS_DATA_LEN |
509 | }, | 527 | }, |
510 | [NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR] = { .len = ETH_ALEN }, | 528 | [NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR] = { |
529 | .type = NLA_EXACT_LEN_WARN, | ||
530 | .len = ETH_ALEN | ||
531 | }, | ||
511 | [NL80211_ATTR_NAN_MASTER_PREF] = NLA_POLICY_MIN(NLA_U8, 1), | 532 | [NL80211_ATTR_NAN_MASTER_PREF] = NLA_POLICY_MIN(NLA_U8, 1), |
512 | [NL80211_ATTR_BANDS] = { .type = NLA_U32 }, | 533 | [NL80211_ATTR_BANDS] = { .type = NLA_U32 }, |
513 | [NL80211_ATTR_NAN_FUNC] = { .type = NLA_NESTED }, | 534 | [NL80211_ATTR_NAN_FUNC] = { .type = NLA_NESTED }, |
514 | [NL80211_ATTR_FILS_KEK] = { .type = NLA_BINARY, | 535 | [NL80211_ATTR_FILS_KEK] = { .type = NLA_BINARY, |
515 | .len = FILS_MAX_KEK_LEN }, | 536 | .len = FILS_MAX_KEK_LEN }, |
516 | [NL80211_ATTR_FILS_NONCES] = { .len = 2 * FILS_NONCE_LEN }, | 537 | [NL80211_ATTR_FILS_NONCES] = { |
538 | .type = NLA_EXACT_LEN_WARN, | ||
539 | .len = 2 * FILS_NONCE_LEN | ||
540 | }, | ||
517 | [NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED] = { .type = NLA_FLAG, }, | 541 | [NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED] = { .type = NLA_FLAG, }, |
518 | [NL80211_ATTR_BSSID] = { .len = ETH_ALEN }, | 542 | [NL80211_ATTR_BSSID] = { .type = NLA_EXACT_LEN_WARN, .len = ETH_ALEN }, |
519 | [NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI] = { .type = NLA_S8 }, | 543 | [NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI] = { .type = NLA_S8 }, |
520 | [NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST] = { | 544 | [NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST] = { |
521 | .len = sizeof(struct nl80211_bss_select_rssi_adjust) | 545 | .len = sizeof(struct nl80211_bss_select_rssi_adjust) |
@@ -528,7 +552,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | |||
528 | [NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM] = { .type = NLA_U16 }, | 552 | [NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM] = { .type = NLA_U16 }, |
529 | [NL80211_ATTR_FILS_ERP_RRK] = { .type = NLA_BINARY, | 553 | [NL80211_ATTR_FILS_ERP_RRK] = { .type = NLA_BINARY, |
530 | .len = FILS_ERP_MAX_RRK_LEN }, | 554 | .len = FILS_ERP_MAX_RRK_LEN }, |
531 | [NL80211_ATTR_FILS_CACHE_ID] = { .len = 2 }, | 555 | [NL80211_ATTR_FILS_CACHE_ID] = { .type = NLA_EXACT_LEN_WARN, .len = 2 }, |
532 | [NL80211_ATTR_PMK] = { .type = NLA_BINARY, .len = PMK_MAX_LEN }, | 556 | [NL80211_ATTR_PMK] = { .type = NLA_BINARY, .len = PMK_MAX_LEN }, |
533 | [NL80211_ATTR_SCHED_SCAN_MULTI] = { .type = NLA_FLAG }, | 557 | [NL80211_ATTR_SCHED_SCAN_MULTI] = { .type = NLA_FLAG }, |
534 | [NL80211_ATTR_EXTERNAL_AUTH_SUPPORT] = { .type = NLA_FLAG }, | 558 | [NL80211_ATTR_EXTERNAL_AUTH_SUPPORT] = { .type = NLA_FLAG }, |
@@ -589,10 +613,13 @@ static const struct nla_policy | |||
589 | nl80211_wowlan_tcp_policy[NUM_NL80211_WOWLAN_TCP] = { | 613 | nl80211_wowlan_tcp_policy[NUM_NL80211_WOWLAN_TCP] = { |
590 | [NL80211_WOWLAN_TCP_SRC_IPV4] = { .type = NLA_U32 }, | 614 | [NL80211_WOWLAN_TCP_SRC_IPV4] = { .type = NLA_U32 }, |
591 | [NL80211_WOWLAN_TCP_DST_IPV4] = { .type = NLA_U32 }, | 615 | [NL80211_WOWLAN_TCP_DST_IPV4] = { .type = NLA_U32 }, |
592 | [NL80211_WOWLAN_TCP_DST_MAC] = { .len = ETH_ALEN }, | 616 | [NL80211_WOWLAN_TCP_DST_MAC] = { |
617 | .type = NLA_EXACT_LEN_WARN, | ||
618 | .len = ETH_ALEN | ||
619 | }, | ||
593 | [NL80211_WOWLAN_TCP_SRC_PORT] = { .type = NLA_U16 }, | 620 | [NL80211_WOWLAN_TCP_SRC_PORT] = { .type = NLA_U16 }, |
594 | [NL80211_WOWLAN_TCP_DST_PORT] = { .type = NLA_U16 }, | 621 | [NL80211_WOWLAN_TCP_DST_PORT] = { .type = NLA_U16 }, |
595 | [NL80211_WOWLAN_TCP_DATA_PAYLOAD] = { .len = 1 }, | 622 | [NL80211_WOWLAN_TCP_DATA_PAYLOAD] = { .type = NLA_MIN_LEN, .len = 1 }, |
596 | [NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ] = { | 623 | [NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ] = { |
597 | .len = sizeof(struct nl80211_wowlan_tcp_data_seq) | 624 | .len = sizeof(struct nl80211_wowlan_tcp_data_seq) |
598 | }, | 625 | }, |
@@ -600,8 +627,8 @@ nl80211_wowlan_tcp_policy[NUM_NL80211_WOWLAN_TCP] = { | |||
600 | .len = sizeof(struct nl80211_wowlan_tcp_data_token) | 627 | .len = sizeof(struct nl80211_wowlan_tcp_data_token) |
601 | }, | 628 | }, |
602 | [NL80211_WOWLAN_TCP_DATA_INTERVAL] = { .type = NLA_U32 }, | 629 | [NL80211_WOWLAN_TCP_DATA_INTERVAL] = { .type = NLA_U32 }, |
603 | [NL80211_WOWLAN_TCP_WAKE_PAYLOAD] = { .len = 1 }, | 630 | [NL80211_WOWLAN_TCP_WAKE_PAYLOAD] = { .type = NLA_MIN_LEN, .len = 1 }, |
604 | [NL80211_WOWLAN_TCP_WAKE_MASK] = { .len = 1 }, | 631 | [NL80211_WOWLAN_TCP_WAKE_MASK] = { .type = NLA_MIN_LEN, .len = 1 }, |
605 | }; | 632 | }; |
606 | #endif /* CONFIG_PM */ | 633 | #endif /* CONFIG_PM */ |
607 | 634 | ||
@@ -619,9 +646,18 @@ nl80211_coalesce_policy[NUM_NL80211_ATTR_COALESCE_RULE] = { | |||
619 | /* policy for GTK rekey offload attributes */ | 646 | /* policy for GTK rekey offload attributes */ |
620 | static const struct nla_policy | 647 | static const struct nla_policy |
621 | nl80211_rekey_policy[NUM_NL80211_REKEY_DATA] = { | 648 | nl80211_rekey_policy[NUM_NL80211_REKEY_DATA] = { |
622 | [NL80211_REKEY_DATA_KEK] = { .len = NL80211_KEK_LEN }, | 649 | [NL80211_REKEY_DATA_KEK] = { |
623 | [NL80211_REKEY_DATA_KCK] = { .len = NL80211_KCK_LEN }, | 650 | .type = NLA_EXACT_LEN_WARN, |
624 | [NL80211_REKEY_DATA_REPLAY_CTR] = { .len = NL80211_REPLAY_CTR_LEN }, | 651 | .len = NL80211_KEK_LEN, |
652 | }, | ||
653 | [NL80211_REKEY_DATA_KCK] = { | ||
654 | .type = NLA_EXACT_LEN_WARN, | ||
655 | .len = NL80211_KCK_LEN, | ||
656 | }, | ||
657 | [NL80211_REKEY_DATA_REPLAY_CTR] = { | ||
658 | .type = NLA_EXACT_LEN_WARN, | ||
659 | .len = NL80211_REPLAY_CTR_LEN | ||
660 | }, | ||
625 | }; | 661 | }; |
626 | 662 | ||
627 | static const struct nla_policy | 663 | static const struct nla_policy |
@@ -635,7 +671,10 @@ static const struct nla_policy | |||
635 | nl80211_match_policy[NL80211_SCHED_SCAN_MATCH_ATTR_MAX + 1] = { | 671 | nl80211_match_policy[NL80211_SCHED_SCAN_MATCH_ATTR_MAX + 1] = { |
636 | [NL80211_SCHED_SCAN_MATCH_ATTR_SSID] = { .type = NLA_BINARY, | 672 | [NL80211_SCHED_SCAN_MATCH_ATTR_SSID] = { .type = NLA_BINARY, |
637 | .len = IEEE80211_MAX_SSID_LEN }, | 673 | .len = IEEE80211_MAX_SSID_LEN }, |
638 | [NL80211_SCHED_SCAN_MATCH_ATTR_BSSID] = { .len = ETH_ALEN }, | 674 | [NL80211_SCHED_SCAN_MATCH_ATTR_BSSID] = { |
675 | .type = NLA_EXACT_LEN_WARN, | ||
676 | .len = ETH_ALEN | ||
677 | }, | ||
639 | [NL80211_SCHED_SCAN_MATCH_ATTR_RSSI] = { .type = NLA_U32 }, | 678 | [NL80211_SCHED_SCAN_MATCH_ATTR_RSSI] = { .type = NLA_U32 }, |
640 | [NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI] = | 679 | [NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI] = |
641 | NLA_POLICY_NESTED(nl80211_match_band_rssi_policy), | 680 | NLA_POLICY_NESTED(nl80211_match_band_rssi_policy), |
@@ -667,7 +706,10 @@ nl80211_nan_func_policy[NL80211_NAN_FUNC_ATTR_MAX + 1] = { | |||
667 | [NL80211_NAN_FUNC_SUBSCRIBE_ACTIVE] = { .type = NLA_FLAG }, | 706 | [NL80211_NAN_FUNC_SUBSCRIBE_ACTIVE] = { .type = NLA_FLAG }, |
668 | [NL80211_NAN_FUNC_FOLLOW_UP_ID] = { .type = NLA_U8 }, | 707 | [NL80211_NAN_FUNC_FOLLOW_UP_ID] = { .type = NLA_U8 }, |
669 | [NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID] = { .type = NLA_U8 }, | 708 | [NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID] = { .type = NLA_U8 }, |
670 | [NL80211_NAN_FUNC_FOLLOW_UP_DEST] = { .len = ETH_ALEN }, | 709 | [NL80211_NAN_FUNC_FOLLOW_UP_DEST] = { |
710 | .type = NLA_EXACT_LEN_WARN, | ||
711 | .len = ETH_ALEN | ||
712 | }, | ||
671 | [NL80211_NAN_FUNC_CLOSE_RANGE] = { .type = NLA_FLAG }, | 713 | [NL80211_NAN_FUNC_CLOSE_RANGE] = { .type = NLA_FLAG }, |
672 | [NL80211_NAN_FUNC_TTL] = { .type = NLA_U32 }, | 714 | [NL80211_NAN_FUNC_TTL] = { .type = NLA_U32 }, |
673 | [NL80211_NAN_FUNC_SERVICE_INFO] = { .type = NLA_BINARY, | 715 | [NL80211_NAN_FUNC_SERVICE_INFO] = { .type = NLA_BINARY, |
@@ -3420,8 +3462,7 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info) | |||
3420 | if (info->attrs[NL80211_ATTR_IFTYPE]) | 3462 | if (info->attrs[NL80211_ATTR_IFTYPE]) |
3421 | type = nla_get_u32(info->attrs[NL80211_ATTR_IFTYPE]); | 3463 | type = nla_get_u32(info->attrs[NL80211_ATTR_IFTYPE]); |
3422 | 3464 | ||
3423 | if (!rdev->ops->add_virtual_intf || | 3465 | if (!rdev->ops->add_virtual_intf) |
3424 | !(rdev->wiphy.interface_modes & (1 << type))) | ||
3425 | return -EOPNOTSUPP; | 3466 | return -EOPNOTSUPP; |
3426 | 3467 | ||
3427 | if ((type == NL80211_IFTYPE_P2P_DEVICE || type == NL80211_IFTYPE_NAN || | 3468 | if ((type == NL80211_IFTYPE_P2P_DEVICE || type == NL80211_IFTYPE_NAN || |
@@ -3440,6 +3481,11 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info) | |||
3440 | return err; | 3481 | return err; |
3441 | } | 3482 | } |
3442 | 3483 | ||
3484 | if (!(rdev->wiphy.interface_modes & (1 << type)) && | ||
3485 | !(type == NL80211_IFTYPE_AP_VLAN && params.use_4addr && | ||
3486 | rdev->wiphy.flags & WIPHY_FLAG_4ADDR_AP)) | ||
3487 | return -EOPNOTSUPP; | ||
3488 | |||
3443 | err = nl80211_parse_mon_options(rdev, type, info, ¶ms); | 3489 | err = nl80211_parse_mon_options(rdev, type, info, ¶ms); |
3444 | if (err < 0) | 3490 | if (err < 0) |
3445 | return err; | 3491 | return err; |
@@ -4057,7 +4103,10 @@ static const struct nla_policy nl80211_txattr_policy[NL80211_TXRATE_MAX + 1] = { | |||
4057 | .len = NL80211_MAX_SUPP_RATES }, | 4103 | .len = NL80211_MAX_SUPP_RATES }, |
4058 | [NL80211_TXRATE_HT] = { .type = NLA_BINARY, | 4104 | [NL80211_TXRATE_HT] = { .type = NLA_BINARY, |
4059 | .len = NL80211_MAX_SUPP_HT_RATES }, | 4105 | .len = NL80211_MAX_SUPP_HT_RATES }, |
4060 | [NL80211_TXRATE_VHT] = { .len = sizeof(struct nl80211_txrate_vht)}, | 4106 | [NL80211_TXRATE_VHT] = { |
4107 | .type = NLA_EXACT_LEN_WARN, | ||
4108 | .len = sizeof(struct nl80211_txrate_vht), | ||
4109 | }, | ||
4061 | [NL80211_TXRATE_GI] = { .type = NLA_U8 }, | 4110 | [NL80211_TXRATE_GI] = { .type = NLA_U8 }, |
4062 | }; | 4111 | }; |
4063 | 4112 | ||
@@ -4856,8 +4905,10 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid, | |||
4856 | struct nlattr *sinfoattr, *bss_param; | 4905 | struct nlattr *sinfoattr, *bss_param; |
4857 | 4906 | ||
4858 | hdr = nl80211hdr_put(msg, portid, seq, flags, cmd); | 4907 | hdr = nl80211hdr_put(msg, portid, seq, flags, cmd); |
4859 | if (!hdr) | 4908 | if (!hdr) { |
4909 | cfg80211_sinfo_release_content(sinfo); | ||
4860 | return -1; | 4910 | return -1; |
4911 | } | ||
4861 | 4912 | ||
4862 | if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || | 4913 | if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || |
4863 | nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr) || | 4914 | nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr) || |
diff --git a/net/wireless/pmsr.c b/net/wireless/pmsr.c index 1b190475359a..c09fbf09549d 100644 --- a/net/wireless/pmsr.c +++ b/net/wireless/pmsr.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
2 | /* | 2 | /* |
3 | * Copyright (C) 2018 Intel Corporation | 3 | * Copyright (C) 2018 - 2019 Intel Corporation |
4 | */ | 4 | */ |
5 | #ifndef __PMSR_H | 5 | #ifndef __PMSR_H |
6 | #define __PMSR_H | 6 | #define __PMSR_H |
@@ -448,7 +448,7 @@ static int nl80211_pmsr_send_result(struct sk_buff *msg, | |||
448 | 448 | ||
449 | if (res->ap_tsf_valid && | 449 | if (res->ap_tsf_valid && |
450 | nla_put_u64_64bit(msg, NL80211_PMSR_RESP_ATTR_AP_TSF, | 450 | nla_put_u64_64bit(msg, NL80211_PMSR_RESP_ATTR_AP_TSF, |
451 | res->host_time, NL80211_PMSR_RESP_ATTR_PAD)) | 451 | res->ap_tsf, NL80211_PMSR_RESP_ATTR_PAD)) |
452 | goto error; | 452 | goto error; |
453 | 453 | ||
454 | if (res->final && nla_put_flag(msg, NL80211_PMSR_RESP_ATTR_FINAL)) | 454 | if (res->final && nla_put_flag(msg, NL80211_PMSR_RESP_ATTR_FINAL)) |
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index c04f5451f89b..aa571d727903 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c | |||
@@ -1601,12 +1601,12 @@ static void cfg80211_parse_mbssid_data(struct wiphy *wiphy, | |||
1601 | continue; | 1601 | continue; |
1602 | } | 1602 | } |
1603 | 1603 | ||
1604 | if (seen_indices & BIT(mbssid_index_ie[2])) | 1604 | if (seen_indices & BIT_ULL(mbssid_index_ie[2])) |
1605 | /* We don't support legacy split of a profile */ | 1605 | /* We don't support legacy split of a profile */ |
1606 | net_dbg_ratelimited("Partial info for BSSID index %d\n", | 1606 | net_dbg_ratelimited("Partial info for BSSID index %d\n", |
1607 | mbssid_index_ie[2]); | 1607 | mbssid_index_ie[2]); |
1608 | 1608 | ||
1609 | seen_indices |= BIT(mbssid_index_ie[2]); | 1609 | seen_indices |= BIT_ULL(mbssid_index_ie[2]); |
1610 | 1610 | ||
1611 | non_tx_data->bssid_index = mbssid_index_ie[2]; | 1611 | non_tx_data->bssid_index = mbssid_index_ie[2]; |
1612 | non_tx_data->max_bssid_indicator = elem->data[0]; | 1612 | non_tx_data->max_bssid_indicator = elem->data[0]; |
diff --git a/net/wireless/util.c b/net/wireless/util.c index cf63b635afc0..1c39d6a2e850 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
@@ -1246,7 +1246,7 @@ static u32 cfg80211_calculate_bitrate_he(struct rate_info *rate) | |||
1246 | if (rate->he_dcm) | 1246 | if (rate->he_dcm) |
1247 | result /= 2; | 1247 | result /= 2; |
1248 | 1248 | ||
1249 | return result; | 1249 | return result / 10000; |
1250 | } | 1250 | } |
1251 | 1251 | ||
1252 | u32 cfg80211_calculate_bitrate(struct rate_info *rate) | 1252 | u32 cfg80211_calculate_bitrate(struct rate_info *rate) |
@@ -1998,7 +1998,7 @@ int ieee80211_get_vht_max_nss(struct ieee80211_vht_cap *cap, | |||
1998 | continue; | 1998 | continue; |
1999 | 1999 | ||
2000 | if (supp >= mcs_encoding) { | 2000 | if (supp >= mcs_encoding) { |
2001 | max_vht_nss = i; | 2001 | max_vht_nss = i + 1; |
2002 | break; | 2002 | break; |
2003 | } | 2003 | } |
2004 | } | 2004 | } |