mac80211: brcmfmac: backport important fixes from kernel 5.2
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 385-cfg80211-nl80211_update_ft_ies-to-validate-NL80211_A.patch
1 From: Arunk Khandavalli <akhandav@codeaurora.org>
2 Date: Thu, 30 Aug 2018 00:40:16 +0300
3 Subject: [PATCH] cfg80211: nl80211_update_ft_ies() to validate
4 NL80211_ATTR_IE
5
6 nl80211_update_ft_ies() tried to validate NL80211_ATTR_IE with
7 is_valid_ie_attr() before dereferencing it, but that helper function
8 returns true in case of NULL pointer (i.e., attribute not included).
9 This can result to dereferencing a NULL pointer. Fix that by explicitly
10 checking that NL80211_ATTR_IE is included.
11
12 Fixes: 355199e02b83 ("cfg80211: Extend support for IEEE 802.11r Fast BSS Transition")
13 Signed-off-by: Arunk Khandavalli <akhandav@codeaurora.org>
14 Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
15 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
16 ---
17
18 --- a/net/wireless/nl80211.c
19 +++ b/net/wireless/nl80211.c
20 @@ -11763,6 +11763,7 @@ static int nl80211_update_ft_ies(struct
21 return -EOPNOTSUPP;
22
23 if (!info->attrs[NL80211_ATTR_MDID] ||
24 + !info->attrs[NL80211_ATTR_IE] ||
25 !is_valid_ie_attr(info->attrs[NL80211_ATTR_IE]))
26 return -EINVAL;
27