Subject: [PATCH AUTOSEL 5.4 56/73] nl80211: add missing attribute validation for critical protocol indication

From: Sasha Levin <[email-masked]>
Date: Wed, 18 Mar 2020 16:53:20 -0400

From: Jakub Kicinski <[email-masked]>

[ Upstream commit 0e1a1d853ecedc99da9d27f9f5c376935547a0e2 ]

Add missing attribute validation for critical protocol fields
to the netlink policy.

Fixes: 5de17984898c ("cfg80211: introduce critical protocol indication from user-space")
Signed-off-by: Jakub Kicinski <[email-masked]>
Link: https://lore.kernel.org/r/[email-masked]
Signed-off-by: Johannes Berg <[email-masked]>
Signed-off-by: Sasha Levin <[email-masked]>
---
 net/wireless/nl80211.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 17514744af9e0..9ca16ca0528ac 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -530,6 +530,8 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
 	[NL80211_ATTR_MDID] = { .type = NLA_U16 },
 	[NL80211_ATTR_IE_RIC] = { .type = NLA_BINARY,
 				  .len = IEEE80211_MAX_DATA_LEN },
+	[NL80211_ATTR_CRIT_PROT_ID] = { .type = NLA_U16 },
+	[NL80211_ATTR_MAX_CRIT_PROT_DURATION] = { .type = NLA_U16 },
 	[NL80211_ATTR_PEER_AID] =
 		NLA_POLICY_RANGE(NLA_U16, 1, IEEE80211_MAX_AID),
 	[NL80211_ATTR_CH_SWITCH_COUNT] = { .type = NLA_U32 },
-- 
2.20.1