Skip to content

Commit

Permalink
nl80211: fix MAC address validation
Browse files Browse the repository at this point in the history
MAC addresses have a fixed length. The current
policy allows passing < ETH_ALEN bytes, which
might result in reading beyond the buffer.

Cc: [email protected]
Signed-off-by: Eliad Peller <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
  • Loading branch information
elp authored and linvjw committed Nov 28, 2011
1 parent 82e5fc2 commit e007b85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
[NL80211_ATTR_IFINDEX] = { .type = NLA_U32 },
[NL80211_ATTR_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ-1 },

[NL80211_ATTR_MAC] = { .type = NLA_BINARY, .len = ETH_ALEN },
[NL80211_ATTR_PREV_BSSID] = { .type = NLA_BINARY, .len = ETH_ALEN },
[NL80211_ATTR_MAC] = { .len = ETH_ALEN },
[NL80211_ATTR_PREV_BSSID] = { .len = ETH_ALEN },

[NL80211_ATTR_KEY] = { .type = NLA_NESTED, },
[NL80211_ATTR_KEY_DATA] = { .type = NLA_BINARY,
Expand Down

0 comments on commit e007b85

Please sign in to comment.