Skip to content

Commit 4954601

Browse files
committed
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: Jan Fuchs <jan.fuchs@lancom.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent f8860ce commit 4954601

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎net/wireless/nl80211.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2764,8 +2764,8 @@ static int nl80211_parse_mon_options(struct cfg80211_registered_device *rdev,
27642764
nla_data(info->attrs[NL80211_ATTR_MU_MIMO_GROUP_DATA]);
27652765

27662766
/* bits 0 and 63 are reserved and must be zero */
2767-
if ((mumimo_groups[0] & BIT(7)) ||
2768-
(mumimo_groups[VHT_MUMIMO_GROUPS_DATA_LEN - 1] & BIT(0)))
2767+
if ((mumimo_groups[0] & BIT(0)) ||
2768+
(mumimo_groups[VHT_MUMIMO_GROUPS_DATA_LEN - 1] & BIT(7)))
27692769
return -EINVAL;
27702770

27712771
params->vht_mumimo_groups = mumimo_groups;

0 commit comments

Comments
 (0)