Unverified Commit d405cb4e authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!10831 wifi: cfg80211: restrict NL80211_ATTR_TXQ_QUANTUM values

parents 57eedf60 591481cc
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -403,6 +403,10 @@ nl80211_unsol_bcast_probe_resp_policy[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX +
						       .len = IEEE80211_MAX_DATA_LEN }
};

static const struct netlink_range_validation q_range = {
	.max = INT_MAX,
};

static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
	[0] = { .strict_start_type = NL80211_ATTR_HE_OBSS_PD },
	[NL80211_ATTR_WIPHY] = { .type = NLA_U32 },
@@ -685,7 +689,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {

	[NL80211_ATTR_TXQ_LIMIT] = { .type = NLA_U32 },
	[NL80211_ATTR_TXQ_MEMORY_LIMIT] = { .type = NLA_U32 },
	[NL80211_ATTR_TXQ_QUANTUM] = { .type = NLA_U32 },
	[NL80211_ATTR_TXQ_QUANTUM] = NLA_POLICY_FULL_RANGE(NLA_U32, &q_range),
	[NL80211_ATTR_HE_CAPABILITY] =
		NLA_POLICY_RANGE(NLA_BINARY,
				 NL80211_HE_MIN_CAPABILITY_LEN,