Commit 4954601f authored by Johannes Berg's avatar Johannes Berg

nl80211: correctly validate MU-MIMO groups

Since groups 0 and 63 are invalid, we should check for those bits.
Note that the 802.11 spec specifies the *bit* order, but the CPU
doesn't care about bit order since it can't address bits, so it's
always treating BIT(0) as the lowest bit within a byte.
Reported-by: default avatarJan Fuchs <jan.fuchs@lancom.de>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent f8860ce8
...@@ -2764,8 +2764,8 @@ static int nl80211_parse_mon_options(struct cfg80211_registered_device *rdev, ...@@ -2764,8 +2764,8 @@ static int nl80211_parse_mon_options(struct cfg80211_registered_device *rdev,
nla_data(info->attrs[NL80211_ATTR_MU_MIMO_GROUP_DATA]); nla_data(info->attrs[NL80211_ATTR_MU_MIMO_GROUP_DATA]);
/* bits 0 and 63 are reserved and must be zero */ /* bits 0 and 63 are reserved and must be zero */
if ((mumimo_groups[0] & BIT(7)) || if ((mumimo_groups[0] & BIT(0)) ||
(mumimo_groups[VHT_MUMIMO_GROUPS_DATA_LEN - 1] & BIT(0))) (mumimo_groups[VHT_MUMIMO_GROUPS_DATA_LEN - 1] & BIT(7)))
return -EINVAL; return -EINVAL;
params->vht_mumimo_groups = mumimo_groups; params->vht_mumimo_groups = mumimo_groups;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment