UPSTREAM: wifi: nl80211: reject fragmented and non-inheritance elements

The underlying mac80211 code cannot deal with fragmented
elements for purposes of sorting the elements into the
association frame, so reject those inside the link. We
might want to reject them inside the assoc frame, but
they're used today for FILS, so cannot do that.

The non-inheritance element inside the links similarly
cannot be handled by mac80211, and outside the links it
makes no sense.

Reject both since using them could lead to an incorrect
implementation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Bug: 253289327
Change-Id: Id53cc57e4ac7ad94b0450293e7ccf9be30fec250
(cherry picked from commit df35f3164ec1150249bcf559e7837edde2a0c66a)
Signed-off-by: Kiran Kumar Lokere <quic_klokere@quicinc.com>
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
This commit is contained in:
Johannes Berg
2022-07-11 14:18:18 +02:00
committed by Todd Kjos
parent c74a4e8436
commit 9e73ea479d

View File

@@ -10718,6 +10718,13 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
if (info->attrs[NL80211_ATTR_IE]) {
req.ie = nla_data(info->attrs[NL80211_ATTR_IE]);
req.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
if (cfg80211_find_ext_elem(WLAN_EID_EXT_NON_INHERITANCE,
req.ie, req.ie_len)) {
GENL_SET_ERR_MSG(info,
"non-inheritance makes no sense");
return -EINVAL;
}
}
if (info->attrs[NL80211_ATTR_USE_MFP]) {
@@ -10862,6 +10869,24 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
nla_data(attrs[NL80211_ATTR_IE]);
req.links[link_id].elems_len =
nla_len(attrs[NL80211_ATTR_IE]);
if (cfg80211_find_elem(WLAN_EID_FRAGMENT,
req.links[link_id].elems,
req.links[link_id].elems_len)) {
GENL_SET_ERR_MSG(info,
"cannot deal with fragmentation");
err = -EINVAL;
goto free;
}
if (cfg80211_find_ext_elem(WLAN_EID_EXT_NON_INHERITANCE,
req.links[link_id].elems,
req.links[link_id].elems_len)) {
GENL_SET_ERR_MSG(info,
"cannot deal with non-inheritance");
err = -EINVAL;
goto free;
}
}
}