Skip to content

Commit

Permalink
cfg80211: validate IBSS BSSID
Browse files Browse the repository at this point in the history
The IBSS BSSID is never validated, so an
invalid one might end up being used. Fix
this by rejecting invalid configuration.

Reported-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Sep 19, 2011
1 parent bbb5574 commit 3919349
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -4527,8 +4527,12 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)

wiphy = &rdev->wiphy;

if (info->attrs[NL80211_ATTR_MAC])
if (info->attrs[NL80211_ATTR_MAC]) {
ibss.bssid = nla_data(info->attrs[NL80211_ATTR_MAC]);

if (!is_valid_ether_addr(ibss.bssid))
return -EINVAL;
}
ibss.ssid = nla_data(info->attrs[NL80211_ATTR_SSID]);
ibss.ssid_len = nla_len(info->attrs[NL80211_ATTR_SSID]);

Expand Down

0 comments on commit 3919349

Please sign in to comment.