]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge tag 'mac80211-for-davem-2017-07-07' of git://git.kernel.org/pub/scm/linux/kerne...
authorDavid S. Miller <davem@davemloft.net>
Fri, 7 Jul 2017 10:35:55 +0000 (11:35 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Jul 2017 10:35:55 +0000 (11:35 +0100)
Johannes Berg says:

====================
pull-request: mac80211 2017-07-07

Just got a set of fixes in from Jouni/QCA, all netlink validation
fixes. I assume they ran some kind of checker, but I don't know what
kind :)

Please pull and let me know if there's any problem.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
net/wireless/nl80211.c

index 45ba3d0872cca715dbd7b93843eb47b57053df6b..8ce85420ecb0a7e45567c9c576c6bb9691eb267d 100644 (file)
@@ -291,8 +291,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
        [NL80211_ATTR_WPA_VERSIONS] = { .type = NLA_U32 },
        [NL80211_ATTR_PID] = { .type = NLA_U32 },
        [NL80211_ATTR_4ADDR] = { .type = NLA_U8 },
-       [NL80211_ATTR_PMKID] = { .type = NLA_BINARY,
-                                .len = WLAN_PMKID_LEN },
+       [NL80211_ATTR_PMKID] = { .len = WLAN_PMKID_LEN },
        [NL80211_ATTR_DURATION] = { .type = NLA_U32 },
        [NL80211_ATTR_COOKIE] = { .type = NLA_U64 },
        [NL80211_ATTR_TX_RATES] = { .type = NLA_NESTED },
@@ -348,6 +347,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
        [NL80211_ATTR_SCAN_FLAGS] = { .type = NLA_U32 },
        [NL80211_ATTR_P2P_CTWINDOW] = { .type = NLA_U8 },
        [NL80211_ATTR_P2P_OPPPS] = { .type = NLA_U8 },
+       [NL80211_ATTR_LOCAL_MESH_POWER_MODE] = {. type = NLA_U32 },
        [NL80211_ATTR_ACL_POLICY] = {. type = NLA_U32 },
        [NL80211_ATTR_MAC_ADDRS] = { .type = NLA_NESTED },
        [NL80211_ATTR_STA_CAPABILITY] = { .type = NLA_U16 },
@@ -520,7 +520,7 @@ nl80211_bss_select_policy[NL80211_BSS_SELECT_ATTR_MAX + 1] = {
 static const struct nla_policy
 nl80211_nan_func_policy[NL80211_NAN_FUNC_ATTR_MAX + 1] = {
        [NL80211_NAN_FUNC_TYPE] = { .type = NLA_U8 },
-       [NL80211_NAN_FUNC_SERVICE_ID] = { .type = NLA_BINARY,
+       [NL80211_NAN_FUNC_SERVICE_ID] = {
                                    .len = NL80211_NAN_FUNC_SERVICE_ID_LEN },
        [NL80211_NAN_FUNC_PUBLISH_TYPE] = { .type = NLA_U8 },
        [NL80211_NAN_FUNC_PUBLISH_BCAST] = { .type = NLA_FLAG },
@@ -6469,6 +6469,10 @@ static int validate_scan_freqs(struct nlattr *freqs)
        struct nlattr *attr1, *attr2;
        int n_channels = 0, tmp1, tmp2;
 
+       nla_for_each_nested(attr1, freqs, tmp1)
+               if (nla_len(attr1) != sizeof(u32))
+                       return 0;
+
        nla_for_each_nested(attr1, freqs, tmp1) {
                n_channels++;
                /*