summaryrefslogtreecommitdiff
path: root/net/mac80211/he.c
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanohar@codeaurora.org>2020-04-25 01:41:39 +0300
committerJohannes Berg <johannes.berg@intel.com>2020-04-29 17:21:45 +0300
commit60689de46c7f6a0028c8b37b6f03db68cbfad8ed (patch)
tree842bdcebaea854a6fb11261721035b0aefb934c9 /net/mac80211/he.c
parent1512bc076e5ba2c4e8a189a4dbc883d59b4c37ef (diff)
downloadlinux-60689de46c7f6a0028c8b37b6f03db68cbfad8ed.tar.xz
mac80211: fix memory overlap due to variable length param
As of now HE operation element in bss_conf includes variable length optional field followed by other HE variable. Though the optional field never be used, actually it is referring to next member of the bss_conf structure which is not correct. Fix it by declaring needed HE operation fields within bss_conf itself. Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org> Link: https://lore.kernel.org/r/1587768108-25248-2-git-send-email-rmanohar@codeaurora.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/he.c')
-rw-r--r--net/mac80211/he.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/net/mac80211/he.c b/net/mac80211/he.c
index 1087f715338b..f520552b22be 100644
--- a/net/mac80211/he.c
+++ b/net/mac80211/he.c
@@ -57,17 +57,14 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata,
void
ieee80211_he_op_ie_to_bss_conf(struct ieee80211_vif *vif,
- const struct ieee80211_he_operation *he_op_ie_elem)
+ const struct ieee80211_he_operation *he_op_ie)
{
- struct ieee80211_he_operation *he_operation =
- &vif->bss_conf.he_operation;
-
- if (!he_op_ie_elem) {
- memset(he_operation, 0, sizeof(*he_operation));
+ memset(&vif->bss_conf.he_oper, 0, sizeof(vif->bss_conf.he_oper));
+ if (!he_op_ie)
return;
- }
- vif->bss_conf.he_operation = *he_op_ie_elem;
+ vif->bss_conf.he_oper.params = __le32_to_cpu(he_op_ie->he_oper_params);
+ vif->bss_conf.he_oper.nss_set = __le16_to_cpu(he_op_ie->he_mcs_nss_set);
}
void