Skip to content

Commit b2a9643

Browse files
committed
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: David S. Miller <[email protected]>
2 parents 09c8b97 + 914eac2 commit b2a9643

File tree

10 files changed

+40
-11
lines changed

10 files changed

+40
-11
lines changed

drivers/net/wireless/mac80211_hwsim.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3236,6 +3236,7 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info)
32363236
GENL_SET_ERR_MSG(info,"MAC is no valid source addr");
32373237
NL_SET_BAD_ATTR(info->extack,
32383238
info->attrs[HWSIM_ATTR_PERM_ADDR]);
3239+
kfree(hwname);
32393240
return -EINVAL;
32403241
}
32413242

include/net/mac80211.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2080,7 +2080,7 @@ struct ieee80211_txq {
20802080
* virtual interface might not be given air time for the transmission of
20812081
* the frame, as it is not synced with the AP/P2P GO yet, and thus the
20822082
* deauthentication frame might not be transmitted.
2083-
>
2083+
*
20842084
* @IEEE80211_HW_DOESNT_SUPPORT_QOS_NDP: The driver (or firmware) doesn't
20852085
* support QoS NDP for AP probing - that's most likely a driver bug.
20862086
*

include/uapi/linux/nl80211.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2698,6 +2698,8 @@ enum nl80211_attrs {
26982698
#define NL80211_ATTR_KEYS NL80211_ATTR_KEYS
26992699
#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
27002700

2701+
#define NL80211_WIPHY_NAME_MAXLEN 128
2702+
27012703
#define NL80211_MAX_SUPP_RATES 32
27022704
#define NL80211_MAX_SUPP_HT_RATES 77
27032705
#define NL80211_MAX_SUPP_REG_RULES 64

net/mac80211/agg-tx.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Copyright 2007, Michael Wu <[email protected]>
99
* Copyright 2007-2010, Intel Corporation
1010
* Copyright(c) 2015-2017 Intel Deutschland GmbH
11+
* Copyright (C) 2018 Intel Corporation
1112
*
1213
* This program is free software; you can redistribute it and/or modify
1314
* 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,
970971

971972
sta->ampdu_mlme.addba_req_num[tid] = 0;
972973

974+
tid_tx->timeout =
975+
le16_to_cpu(mgmt->u.action.u.addba_resp.timeout);
976+
973977
if (tid_tx->timeout) {
974978
mod_timer(&tid_tx->session_timer,
975979
TU_TO_EXP_TIME(tid_tx->timeout));

net/mac80211/mlme.c

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#define IEEE80211_AUTH_TIMEOUT (HZ / 5)
3737
#define IEEE80211_AUTH_TIMEOUT_LONG (HZ / 2)
3838
#define IEEE80211_AUTH_TIMEOUT_SHORT (HZ / 10)
39+
#define IEEE80211_AUTH_TIMEOUT_SAE (HZ * 2)
3940
#define IEEE80211_AUTH_MAX_TRIES 3
4041
#define IEEE80211_AUTH_WAIT_ASSOC (HZ * 5)
4142
#define IEEE80211_ASSOC_TIMEOUT (HZ / 5)
@@ -1787,7 +1788,7 @@ static bool ieee80211_sta_wmm_params(struct ieee80211_local *local,
17871788
params[ac].acm = acm;
17881789
params[ac].uapsd = uapsd;
17891790

1790-
if (params->cw_min == 0 ||
1791+
if (params[ac].cw_min == 0 ||
17911792
params[ac].cw_min > params[ac].cw_max) {
17921793
sdata_info(sdata,
17931794
"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)
38143815
tx_flags);
38153816

38163817
if (tx_flags == 0) {
3817-
auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT;
3818-
auth_data->timeout_started = true;
3819-
run_again(sdata, auth_data->timeout);
3818+
if (auth_data->algorithm == WLAN_AUTH_SAE)
3819+
auth_data->timeout = jiffies +
3820+
IEEE80211_AUTH_TIMEOUT_SAE;
3821+
else
3822+
auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT;
38203823
} else {
38213824
auth_data->timeout =
38223825
round_jiffies_up(jiffies + IEEE80211_AUTH_TIMEOUT_LONG);
3823-
auth_data->timeout_started = true;
3824-
run_again(sdata, auth_data->timeout);
38253826
}
38263827

3828+
auth_data->timeout_started = true;
3829+
run_again(sdata, auth_data->timeout);
3830+
38273831
return 0;
38283832
}
38293833

@@ -3894,8 +3898,15 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
38943898
ifmgd->status_received = false;
38953899
if (ifmgd->auth_data && ieee80211_is_auth(fc)) {
38963900
if (status_acked) {
3897-
ifmgd->auth_data->timeout =
3898-
jiffies + IEEE80211_AUTH_TIMEOUT_SHORT;
3901+
if (ifmgd->auth_data->algorithm ==
3902+
WLAN_AUTH_SAE)
3903+
ifmgd->auth_data->timeout =
3904+
jiffies +
3905+
IEEE80211_AUTH_TIMEOUT_SAE;
3906+
else
3907+
ifmgd->auth_data->timeout =
3908+
jiffies +
3909+
IEEE80211_AUTH_TIMEOUT_SHORT;
38993910
run_again(sdata, ifmgd->auth_data->timeout);
39003911
} else {
39013912
ifmgd->auth_data->timeout = jiffies - 1;

net/mac80211/tx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Copyright 2006-2007 Jiri Benc <[email protected]>
55
* Copyright 2007 Johannes Berg <[email protected]>
66
* Copyright 2013-2014 Intel Mobile Communications GmbH
7+
* Copyright (C) 2018 Intel Corporation
78
*
89
* This program is free software; you can redistribute it and/or modify
910
* 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,
11351136
}
11361137

11371138
/* reset session timer */
1138-
if (reset_agg_timer && tid_tx->timeout)
1139+
if (reset_agg_timer)
11391140
tid_tx->last_tx = jiffies;
11401141

11411142
return queued;

net/rfkill/rfkill-gpio.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,18 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
137137

138138
ret = rfkill_register(rfkill->rfkill_dev);
139139
if (ret < 0)
140-
return ret;
140+
goto err_destroy;
141141

142142
platform_set_drvdata(pdev, rfkill);
143143

144144
dev_info(&pdev->dev, "%s device registered.\n", rfkill->name);
145145

146146
return 0;
147+
148+
err_destroy:
149+
rfkill_destroy(rfkill->rfkill_dev);
150+
151+
return ret;
147152
}
148153

149154
static int rfkill_gpio_remove(struct platform_device *pdev)

net/wireless/core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ static int cfg80211_dev_check_name(struct cfg80211_registered_device *rdev,
9595

9696
ASSERT_RTNL();
9797

98+
if (strlen(newname) > NL80211_WIPHY_NAME_MAXLEN)
99+
return -EINVAL;
100+
98101
/* prohibit calling the thing phy%d when %d is not its number */
99102
sscanf(newname, PHY_NAME "%d%n", &wiphy_idx, &taken);
100103
if (taken == strlen(newname) && wiphy_idx != rdev->wiphy_idx) {

net/wireless/nl80211.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9214,6 +9214,7 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
92149214

92159215
if (nla_get_flag(info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT])) {
92169216
if (!info->attrs[NL80211_ATTR_SOCKET_OWNER]) {
9217+
kzfree(connkeys);
92179218
GENL_SET_ERR_MSG(info,
92189219
"external auth requires connection ownership");
92199220
return -EINVAL;

net/wireless/reg.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,7 @@ static int regdb_query_country(const struct fwdb_header *db,
10261026

10271027
if (!tmp_rd) {
10281028
kfree(regdom);
1029+
kfree(wmm_ptrs);
10291030
return -ENOMEM;
10301031
}
10311032
regdom = tmp_rd;

0 commit comments

Comments
 (0)