From: Greg Kroah-Hartman Date: Thu, 10 Oct 2019 05:44:15 +0000 (+0200) Subject: fix up 4.9 nl80211 patch X-Git-Tag: v4.14.149~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2869359a1dc0762e92349768318fc4c3b6b35057;p=thirdparty%2Fkernel%2Fstable-queue.git fix up 4.9 nl80211 patch --- diff --git a/queue-4.9/nl80211-validate-beacon-head.patch b/queue-4.9/nl80211-validate-beacon-head.patch index 4fed427bb9a..9f8943bc6a1 100644 --- a/queue-4.9/nl80211-validate-beacon-head.patch +++ b/queue-4.9/nl80211-validate-beacon-head.patch @@ -23,17 +23,16 @@ Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- - net/wireless/nl80211.c | 38 ++++++++++++++++++++++++++++++++++++++ - 1 file changed, 38 insertions(+) + net/wireless/nl80211.c | 35 +++++++++++++++++++++++++++++++++++ + 1 file changed, 35 insertions(+) --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -213,6 +213,38 @@ cfg80211_get_dev_from_info(struct net *n +@@ -213,6 +213,36 @@ cfg80211_get_dev_from_info(struct net *n return __cfg80211_rdev_from_attrs(netns, info->attrs); } -+static int validate_beacon_head(const struct nlattr *attr, -+ struct netlink_ext_ack *extack) ++static int validate_beacon_head(const struct nlattr *attr) +{ + const u8 *data = nla_data(attr); + unsigned int len = nla_len(attr); @@ -60,19 +59,17 @@ Signed-off-by: Greg Kroah-Hartman + return 0; + +err: -+ NL_SET_ERR_MSG_ATTR(extack, attr, "malformed beacon head"); + return -EINVAL; +} + /* policy for the attributes */ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_WIPHY] = { .type = NLA_U32 }, -@@ -3680,6 +3712,12 @@ static int nl80211_parse_beacon(struct n +@@ -3680,6 +3710,11 @@ static int nl80211_parse_beacon(struct n memset(bcn, 0, sizeof(*bcn)); if (attrs[NL80211_ATTR_BEACON_HEAD]) { -+ int ret = validate_beacon_head(attrs[NL80211_ATTR_BEACON_HEAD], -+ NULL); ++ int ret = validate_beacon_head(attrs[NL80211_ATTR_BEACON_HEAD]); + + if (ret) + return ret;