Skip to contentSkip to conversation

nl80211: add missing attribute validation

PATCH In review Jakub Kicinski 2 participants 7 messages Mar 3, 2020

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

cover nl80211: add missing attribute validation

Hi!

Wireless seems to be missing a handful of netlink policy entries.

Compilation tested only.

Jakub Kicinski (3):
nl80211: add missing attribute validation for critical protocol
indication
nl80211: add missing attribute validation for beacon report scanning
nl80211: add missing attribute validation for channel switch

 net/wireless/nl80211.c | 5 +++++
 1 file changed, 5 insertions(+)
Signature · 1 line
2.24.1
author maintainer
#1 lore raw

PATCH 1/3 nl80211: add missing attribute validation for critical protocol indication

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

Fixes 5de17984898c ("cfg80211: introduce critical protocol indication from user-space")

---
CC: "Franky (Zhenhui) Lin" <[email protected]>
CC: Arend van Spriel <[email protected]>
CC: Pieter-Paul Giesberts <[email protected]>

Leaving the conversion to RANGE to a follow up,
as this may get stabled.

---
 net/wireless/nl80211.c | 2 ++
 1 file changed, 2 insertions(+)
net/wireless/nl80211.c +2 -0
index 5b19e9fac4aa..cd0e024d7cb6 100644
@@ -531,6 +531,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 },
Signature · 1 line
2.24.1
author maintainer
#2 lore raw

PATCH 2/3 nl80211: add missing attribute validation for beacon report scanning

In reply to Jakub Kicinski

Add missing attribute validation for beacon report scanning to the netlink policy.

Fixes 1d76250bd34a ("nl80211: support beacon report scanning")

---
CC: David Spinadel <[email protected]>
CC: Luca Coelho <[email protected]>
CC: Avraham Stern <[email protected]>
CC: Assaf Krauss <[email protected]>

---
 net/wireless/nl80211.c | 2 ++
 1 file changed, 2 insertions(+)
net/wireless/nl80211.c +2 -0
index cd0e024d7cb6..48e6508aba52 100644
@@ -470,6 +470,8 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
 	[NL80211_ATTR_WOWLAN_TRIGGERS] = { .type = NLA_NESTED },
 	[NL80211_ATTR_STA_PLINK_STATE] =
 		NLA_POLICY_MAX(NLA_U8, NUM_NL80211_PLINK_STATES - 1),
+	[NL80211_ATTR_MEASUREMENT_DURATION] = { .type = NLA_U16 },
+	[NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY] = { .type = NLA_FLAG },
 	[NL80211_ATTR_MESH_PEER_AID] =
 		NLA_POLICY_RANGE(NLA_U16, 1, IEEE80211_MAX_AID),
 	[NL80211_ATTR_SCHED_SCAN_INTERVAL] = { .type = NLA_U32 },
Signature · 1 line
2.24.1
author maintainer
#3 lore raw

PATCH 3/3 nl80211: add missing attribute validation for channel switch

In reply to Jakub Kicinski

Add missing attribute validation for NL80211_ATTR_OPER_CLASS to the netlink policy.

Fixes 1057d35ede5d ("cfg80211: introduce TDLS channel switch commands")

---
CC: Arik Nemtsov <[email protected]>

---
 net/wireless/nl80211.c | 1 +
 1 file changed, 1 insertion(+)
net/wireless/nl80211.c +1 -0
index 48e6508aba52..ec5d67794aab 100644
@@ -565,6 +565,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
 		NLA_POLICY_MAX(NLA_U8, IEEE80211_NUM_UPS - 1),
 	[NL80211_ATTR_ADMITTED_TIME] = { .type = NLA_U16 },
 	[NL80211_ATTR_SMPS_MODE] = { .type = NLA_U8 },
+	[NL80211_ATTR_OPER_CLASS] = { .type = NLA_U8 },
 	[NL80211_ATTR_MAC_MASK] = {
 		.type = NLA_EXACT_LEN_WARN,
 		.len = ETH_ALEN
Signature · 1 line
2.24.1
maintainer Reviewed-by on the v1 series
#4 lore raw
In reply to Jakub Kicinski

Hi Jakub,

Quoted 1 line

Wireless seems to be missing a handful of netlink policy entries.

Yep, these look good to me.

Here's a

if you want to apply them directly? I can take them, but you said later you might want to pick them into stable, so maybe you have some more direct plan there?

Thanks,
johannes

author maintainer
#5 lore raw
Quoted 11 lines · On Tue, 03 Mar 2020 08:29:46 +0100 Johannes Berg wrote:

Hi Jakub,

Quoted 1 line

Wireless seems to be missing a handful of netlink policy entries.

Yep, these look good to me.

Here's a

if you want to apply them directly?

Up to Dave, I only put a maintainer hat to cover for Dave when he's away :)

Quoted 2 lines

I can take them, but you said later you might want to pick them into stable, so maybe you have some more direct plan there?

No real plan, but the autoselection bot will very likely pick those up even if we don't do anything, so given the very limited testing I was cautious with refactoring.

maintainer
#6 lore raw
Quoted 7 lines · Jakub Kicinski
Quoted 6 lines · On Tue, 03 Mar 2020 08:29:46 +0100 Johannes Berg wrote:

Hi Jakub,

Quoted 1 line

Wireless seems to be missing a handful of netlink policy entries.

Yep, these look good to me.

Quoted 8 lines
Quoted 5 lines

Here's a

if you want to apply them directly?

Up to Dave, I only put a maintainer hat to cover for Dave when he's away :)

Ah, ok; I'll just take them then, that's easier.

johannes