Commit b2a96438 authored by David S. Miller's avatar David S. Miller

Merge tag 'mac80211-for-davem-2018-05-09' of...

Merge tag 'mac80211-for-davem-2018-05-09' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211

Johannes Berg says:

====================
We only have a few fixes this time:
 * WMM element validation
 * SAE timeout
 * add-BA timeout
 * docbook parsing
 * a few memory leaks in error paths
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 09c8b971 914eac24
...@@ -3236,6 +3236,7 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info) ...@@ -3236,6 +3236,7 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info)
GENL_SET_ERR_MSG(info,"MAC is no valid source addr"); GENL_SET_ERR_MSG(info,"MAC is no valid source addr");
NL_SET_BAD_ATTR(info->extack, NL_SET_BAD_ATTR(info->extack,
info->attrs[HWSIM_ATTR_PERM_ADDR]); info->attrs[HWSIM_ATTR_PERM_ADDR]);
kfree(hwname);
return -EINVAL; return -EINVAL;
} }
......
...@@ -2080,7 +2080,7 @@ struct ieee80211_txq { ...@@ -2080,7 +2080,7 @@ struct ieee80211_txq {
* virtual interface might not be given air time for the transmission of * virtual interface might not be given air time for the transmission of
* the frame, as it is not synced with the AP/P2P GO yet, and thus the * the frame, as it is not synced with the AP/P2P GO yet, and thus the
* deauthentication frame might not be transmitted. * deauthentication frame might not be transmitted.
> *
* @IEEE80211_HW_DOESNT_SUPPORT_QOS_NDP: The driver (or firmware) doesn't * @IEEE80211_HW_DOESNT_SUPPORT_QOS_NDP: The driver (or firmware) doesn't
* support QoS NDP for AP probing - that's most likely a driver bug. * support QoS NDP for AP probing - that's most likely a driver bug.
* *
......
...@@ -2698,6 +2698,8 @@ enum nl80211_attrs { ...@@ -2698,6 +2698,8 @@ enum nl80211_attrs {
#define NL80211_ATTR_KEYS NL80211_ATTR_KEYS #define NL80211_ATTR_KEYS NL80211_ATTR_KEYS
#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS #define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
#define NL80211_WIPHY_NAME_MAXLEN 128
#define NL80211_MAX_SUPP_RATES 32 #define NL80211_MAX_SUPP_RATES 32
#define NL80211_MAX_SUPP_HT_RATES 77 #define NL80211_MAX_SUPP_HT_RATES 77
#define NL80211_MAX_SUPP_REG_RULES 64 #define NL80211_MAX_SUPP_REG_RULES 64
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
* Copyright 2007, Michael Wu <flamingice@sourmilk.net> * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
* Copyright 2007-2010, Intel Corporation * Copyright 2007-2010, Intel Corporation
* Copyright(c) 2015-2017 Intel Deutschland GmbH * Copyright(c) 2015-2017 Intel Deutschland GmbH
* Copyright (C) 2018 Intel Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
...@@ -970,6 +971,9 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, ...@@ -970,6 +971,9 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
sta->ampdu_mlme.addba_req_num[tid] = 0; sta->ampdu_mlme.addba_req_num[tid] = 0;
tid_tx->timeout =
le16_to_cpu(mgmt->u.action.u.addba_resp.timeout);
if (tid_tx->timeout) { if (tid_tx->timeout) {
mod_timer(&tid_tx->session_timer, mod_timer(&tid_tx->session_timer,
TU_TO_EXP_TIME(tid_tx->timeout)); TU_TO_EXP_TIME(tid_tx->timeout));
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#define IEEE80211_AUTH_TIMEOUT (HZ / 5) #define IEEE80211_AUTH_TIMEOUT (HZ / 5)
#define IEEE80211_AUTH_TIMEOUT_LONG (HZ / 2) #define IEEE80211_AUTH_TIMEOUT_LONG (HZ / 2)
#define IEEE80211_AUTH_TIMEOUT_SHORT (HZ / 10) #define IEEE80211_AUTH_TIMEOUT_SHORT (HZ / 10)
#define IEEE80211_AUTH_TIMEOUT_SAE (HZ * 2)
#define IEEE80211_AUTH_MAX_TRIES 3 #define IEEE80211_AUTH_MAX_TRIES 3
#define IEEE80211_AUTH_WAIT_ASSOC (HZ * 5) #define IEEE80211_AUTH_WAIT_ASSOC (HZ * 5)
#define IEEE80211_ASSOC_TIMEOUT (HZ / 5) #define IEEE80211_ASSOC_TIMEOUT (HZ / 5)
...@@ -1787,7 +1788,7 @@ static bool ieee80211_sta_wmm_params(struct ieee80211_local *local, ...@@ -1787,7 +1788,7 @@ static bool ieee80211_sta_wmm_params(struct ieee80211_local *local,
params[ac].acm = acm; params[ac].acm = acm;
params[ac].uapsd = uapsd; params[ac].uapsd = uapsd;
if (params->cw_min == 0 || if (params[ac].cw_min == 0 ||
params[ac].cw_min > params[ac].cw_max) { params[ac].cw_min > params[ac].cw_max) {
sdata_info(sdata, sdata_info(sdata,
"AP has invalid WMM params (CWmin/max=%d/%d for ACI %d), using defaults\n", "AP has invalid WMM params (CWmin/max=%d/%d for ACI %d), using defaults\n",
...@@ -3814,16 +3815,19 @@ static int ieee80211_auth(struct ieee80211_sub_if_data *sdata) ...@@ -3814,16 +3815,19 @@ static int ieee80211_auth(struct ieee80211_sub_if_data *sdata)
tx_flags); tx_flags);
if (tx_flags == 0) { if (tx_flags == 0) {
auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; if (auth_data->algorithm == WLAN_AUTH_SAE)
auth_data->timeout_started = true; auth_data->timeout = jiffies +
run_again(sdata, auth_data->timeout); IEEE80211_AUTH_TIMEOUT_SAE;
else
auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT;
} else { } else {
auth_data->timeout = auth_data->timeout =
round_jiffies_up(jiffies + IEEE80211_AUTH_TIMEOUT_LONG); round_jiffies_up(jiffies + IEEE80211_AUTH_TIMEOUT_LONG);
auth_data->timeout_started = true;
run_again(sdata, auth_data->timeout);
} }
auth_data->timeout_started = true;
run_again(sdata, auth_data->timeout);
return 0; return 0;
} }
...@@ -3894,8 +3898,15 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata) ...@@ -3894,8 +3898,15 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
ifmgd->status_received = false; ifmgd->status_received = false;
if (ifmgd->auth_data && ieee80211_is_auth(fc)) { if (ifmgd->auth_data && ieee80211_is_auth(fc)) {
if (status_acked) { if (status_acked) {
ifmgd->auth_data->timeout = if (ifmgd->auth_data->algorithm ==
jiffies + IEEE80211_AUTH_TIMEOUT_SHORT; WLAN_AUTH_SAE)
ifmgd->auth_data->timeout =
jiffies +
IEEE80211_AUTH_TIMEOUT_SAE;
else
ifmgd->auth_data->timeout =
jiffies +
IEEE80211_AUTH_TIMEOUT_SHORT;
run_again(sdata, ifmgd->auth_data->timeout); run_again(sdata, ifmgd->auth_data->timeout);
} else { } else {
ifmgd->auth_data->timeout = jiffies - 1; ifmgd->auth_data->timeout = jiffies - 1;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
* Copyright 2007 Johannes Berg <johannes@sipsolutions.net> * Copyright 2007 Johannes Berg <johannes@sipsolutions.net>
* Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright 2013-2014 Intel Mobile Communications GmbH
* Copyright (C) 2018 Intel Corporation
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
...@@ -1135,7 +1136,7 @@ static bool ieee80211_tx_prep_agg(struct ieee80211_tx_data *tx, ...@@ -1135,7 +1136,7 @@ static bool ieee80211_tx_prep_agg(struct ieee80211_tx_data *tx,
} }
/* reset session timer */ /* reset session timer */
if (reset_agg_timer && tid_tx->timeout) if (reset_agg_timer)
tid_tx->last_tx = jiffies; tid_tx->last_tx = jiffies;
return queued; return queued;
......
...@@ -137,13 +137,18 @@ static int rfkill_gpio_probe(struct platform_device *pdev) ...@@ -137,13 +137,18 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
ret = rfkill_register(rfkill->rfkill_dev); ret = rfkill_register(rfkill->rfkill_dev);
if (ret < 0) if (ret < 0)
return ret; goto err_destroy;
platform_set_drvdata(pdev, rfkill); platform_set_drvdata(pdev, rfkill);
dev_info(&pdev->dev, "%s device registered.\n", rfkill->name); dev_info(&pdev->dev, "%s device registered.\n", rfkill->name);
return 0; return 0;
err_destroy:
rfkill_destroy(rfkill->rfkill_dev);
return ret;
} }
static int rfkill_gpio_remove(struct platform_device *pdev) static int rfkill_gpio_remove(struct platform_device *pdev)
......
...@@ -95,6 +95,9 @@ static int cfg80211_dev_check_name(struct cfg80211_registered_device *rdev, ...@@ -95,6 +95,9 @@ static int cfg80211_dev_check_name(struct cfg80211_registered_device *rdev,
ASSERT_RTNL(); ASSERT_RTNL();
if (strlen(newname) > NL80211_WIPHY_NAME_MAXLEN)
return -EINVAL;
/* prohibit calling the thing phy%d when %d is not its number */ /* prohibit calling the thing phy%d when %d is not its number */
sscanf(newname, PHY_NAME "%d%n", &wiphy_idx, &taken); sscanf(newname, PHY_NAME "%d%n", &wiphy_idx, &taken);
if (taken == strlen(newname) && wiphy_idx != rdev->wiphy_idx) { if (taken == strlen(newname) && wiphy_idx != rdev->wiphy_idx) {
......
...@@ -9214,6 +9214,7 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info) ...@@ -9214,6 +9214,7 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
if (nla_get_flag(info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT])) { if (nla_get_flag(info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT])) {
if (!info->attrs[NL80211_ATTR_SOCKET_OWNER]) { if (!info->attrs[NL80211_ATTR_SOCKET_OWNER]) {
kzfree(connkeys);
GENL_SET_ERR_MSG(info, GENL_SET_ERR_MSG(info,
"external auth requires connection ownership"); "external auth requires connection ownership");
return -EINVAL; return -EINVAL;
......
...@@ -1026,6 +1026,7 @@ static int regdb_query_country(const struct fwdb_header *db, ...@@ -1026,6 +1026,7 @@ static int regdb_query_country(const struct fwdb_header *db,
if (!tmp_rd) { if (!tmp_rd) {
kfree(regdom); kfree(regdom);
kfree(wmm_ptrs);
return -ENOMEM; return -ENOMEM;
} }
regdom = tmp_rd; regdom = tmp_rd;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment