Skip to content

Commit b27f07c

Browse files
committed
wifi: nl80211: fix puncturing bitmap policy
This was meant to be a u32, and while applying the patch I tried to use policy validation for it. However, not only did I copy/paste it to u8 instead of u32, but also used the policy range erroneously. Fix both of these issues. Fixes: d7c1a9a ("wifi: nl80211: validate and configure puncturing bitmap") Signed-off-by: Johannes Berg <[email protected]>
1 parent f624bb6 commit b27f07c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

net/wireless/nl80211.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,11 @@ nl80211_sta_wme_policy[NL80211_STA_WME_MAX + 1] = {
462462
[NL80211_STA_WME_MAX_SP] = { .type = NLA_U8 },
463463
};
464464

465+
static struct netlink_range_validation nl80211_punct_bitmap_range = {
466+
.min = 0,
467+
.max = 0xffff,
468+
};
469+
465470
static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
466471
[0] = { .strict_start_type = NL80211_ATTR_HE_OBSS_PD },
467472
[NL80211_ATTR_WIPHY] = { .type = NLA_U32 },
@@ -805,7 +810,8 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
805810
[NL80211_ATTR_MLD_ADDR] = NLA_POLICY_EXACT_LEN(ETH_ALEN),
806811
[NL80211_ATTR_MLO_SUPPORT] = { .type = NLA_FLAG },
807812
[NL80211_ATTR_MAX_NUM_AKM_SUITES] = { .type = NLA_REJECT },
808-
[NL80211_ATTR_PUNCT_BITMAP] = NLA_POLICY_RANGE(NLA_U8, 0, 0xffff),
813+
[NL80211_ATTR_PUNCT_BITMAP] =
814+
NLA_POLICY_FULL_RANGE(NLA_U32, &nl80211_punct_bitmap_range),
809815
};
810816

811817
/* policy for the key attributes */

0 commit comments

Comments
 (0)