Skip to content

Commit 0eaf83d

Browse files
committed
Merge tag 'mac80211-for-davem-2017-07-07' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
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>
2 parents 01c3521 + d7f13f7 commit 0eaf83d

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎net/wireless/nl80211.c‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
291291
[NL80211_ATTR_WPA_VERSIONS] = { .type = NLA_U32 },
292292
[NL80211_ATTR_PID] = { .type = NLA_U32 },
293293
[NL80211_ATTR_4ADDR] = { .type = NLA_U8 },
294-
[NL80211_ATTR_PMKID] = { .type = NLA_BINARY,
295-
.len = WLAN_PMKID_LEN },
294+
[NL80211_ATTR_PMKID] = { .len = WLAN_PMKID_LEN },
296295
[NL80211_ATTR_DURATION] = { .type = NLA_U32 },
297296
[NL80211_ATTR_COOKIE] = { .type = NLA_U64 },
298297
[NL80211_ATTR_TX_RATES] = { .type = NLA_NESTED },
@@ -348,6 +347,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
348347
[NL80211_ATTR_SCAN_FLAGS] = { .type = NLA_U32 },
349348
[NL80211_ATTR_P2P_CTWINDOW] = { .type = NLA_U8 },
350349
[NL80211_ATTR_P2P_OPPPS] = { .type = NLA_U8 },
350+
[NL80211_ATTR_LOCAL_MESH_POWER_MODE] = {. type = NLA_U32 },
351351
[NL80211_ATTR_ACL_POLICY] = {. type = NLA_U32 },
352352
[NL80211_ATTR_MAC_ADDRS] = { .type = NLA_NESTED },
353353
[NL80211_ATTR_STA_CAPABILITY] = { .type = NLA_U16 },
@@ -520,7 +520,7 @@ nl80211_bss_select_policy[NL80211_BSS_SELECT_ATTR_MAX + 1] = {
520520
static const struct nla_policy
521521
nl80211_nan_func_policy[NL80211_NAN_FUNC_ATTR_MAX + 1] = {
522522
[NL80211_NAN_FUNC_TYPE] = { .type = NLA_U8 },
523-
[NL80211_NAN_FUNC_SERVICE_ID] = { .type = NLA_BINARY,
523+
[NL80211_NAN_FUNC_SERVICE_ID] = {
524524
.len = NL80211_NAN_FUNC_SERVICE_ID_LEN },
525525
[NL80211_NAN_FUNC_PUBLISH_TYPE] = { .type = NLA_U8 },
526526
[NL80211_NAN_FUNC_PUBLISH_BCAST] = { .type = NLA_FLAG },
@@ -6469,6 +6469,10 @@ static int validate_scan_freqs(struct nlattr *freqs)
64696469
struct nlattr *attr1, *attr2;
64706470
int n_channels = 0, tmp1, tmp2;
64716471

6472+
nla_for_each_nested(attr1, freqs, tmp1)
6473+
if (nla_len(attr1) != sizeof(u32))
6474+
return 0;
6475+
64726476
nla_for_each_nested(attr1, freqs, tmp1) {
64736477
n_channels++;
64746478
/*

0 commit comments

Comments
 (0)