]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fix up 4.9 nl80211 patch
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2019 05:44:15 +0000 (07:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2019 05:44:15 +0000 (07:44 +0200)
queue-4.9/nl80211-validate-beacon-head.patch

index 4fed427bb9a9070003ea751eecbff08b3e840524..9f8943bc6a1021c19d1ada727251794726c2d8aa 100644 (file)
@@ -23,17 +23,16 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
 ---
- net/wireless/nl80211.c |   38 ++++++++++++++++++++++++++++++++++++++
- 1 file changed, 38 insertions(+)
+ net/wireless/nl80211.c |   3+++++++++++++++++++++++++++++++++++
+ 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 <gregkh@linuxfoundation.org>
 +              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;