All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nl80211: relax ht operation checks for mesh
@ 2018-06-25  1:10 Bob Copeland
  2018-06-25  5:54 ` Masashi Honma
  2018-06-25  6:01 ` Masashi Honma
  0 siblings, 2 replies; 3+ messages in thread
From: Bob Copeland @ 2018-06-25  1:10 UTC (permalink / raw
  To: Johannes Berg
  Cc: linux-wireless, kernel-team, Bob Copeland, Masashi Honma,
	Bob Copeland

Commit 9757235f451c, "nl80211: correct checks for
NL80211_MESHCONF_HT_OPMODE value") relaxed the range for the HT
operation field in meshconf, while also adding checks requiring
the non-greenfield and non-ht-sta bits to be set in certain
circumstances.  The latter bit is actually reserved for mesh BSSes
according to Table 9-168 in 802.11-2016, so in fact it should not
be set.

wpa_supplicant sets these bits because the mesh and AP code share
the same implementation, but authsae does not.  As a result, some
meshconf updates from authsae which set only the NONHT_MIXED
protection bits were being rejected.

In order to avoid breaking userspace by changing the rules again,
simply accept the values with or without the bits set, and mask
off the reserved bit to match the spec.

While in here, update the 802.11-2012 reference to 802.11-2016.

Fixes: 9757235f451c ("nl80211: correct checks for NL80211_MESHCONF_HT_OPMODE value")
Cc: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Bob Copeland <bobcopeland@fb.com>
---
 net/wireless/nl80211.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index f5e36a23cae3..c9ba4edf25cc 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5837,7 +5837,7 @@ do {									    \
 				  nl80211_check_s32);
 	/*
 	 * Check HT operation mode based on
-	 * IEEE 802.11 2012 8.4.2.59 HT Operation element.
+	 * IEEE 802.11-2016 9.4.2.57 HT Operation element.
 	 */
 	if (tb[NL80211_MESHCONF_HT_OPMODE]) {
 		ht_opmode = nla_get_u16(tb[NL80211_MESHCONF_HT_OPMODE]);
@@ -5847,22 +5847,9 @@ do {									    \
 				  IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT))
 			return -EINVAL;
 
-		if ((ht_opmode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) &&
-		    (ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT))
-			return -EINVAL;
+		/* NON_HT_STA bit is reserved, but some programs set it */
+		ht_opmode &= ~IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT;
 
-		switch (ht_opmode & IEEE80211_HT_OP_MODE_PROTECTION) {
-		case IEEE80211_HT_OP_MODE_PROTECTION_NONE:
-		case IEEE80211_HT_OP_MODE_PROTECTION_20MHZ:
-			if (ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT)
-				return -EINVAL;
-			break;
-		case IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER:
-		case IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED:
-			if (!(ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT))
-				return -EINVAL;
-			break;
-		}
 		cfg->ht_opmode = ht_opmode;
 		mask |= (1 << (NL80211_MESHCONF_HT_OPMODE - 1));
 	}
-- 
2.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] nl80211: relax ht operation checks for mesh
  2018-06-25  1:10 [PATCH] nl80211: relax ht operation checks for mesh Bob Copeland
@ 2018-06-25  5:54 ` Masashi Honma
  2018-06-25  6:01 ` Masashi Honma
  1 sibling, 0 replies; 3+ messages in thread
From: Masashi Honma @ 2018-06-25  5:54 UTC (permalink / raw
  To: Bob Copeland; +Cc: Johannes Berg, linux-wireless, kernel-team, Bob Copeland

On 2018/06/25 10:10, Bob Copeland wrote:
> The latter bit is actually reserved for mesh BSSes
> according to Table 9-168 in 802.11-2016, so in fact it should not
> be set.

Good catch !
Indeed the bit is reserved at non-AP case.

Reviewed-by: Masashi Honma <masashi.honma@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] nl80211: relax ht operation checks for mesh
  2018-06-25  1:10 [PATCH] nl80211: relax ht operation checks for mesh Bob Copeland
  2018-06-25  5:54 ` Masashi Honma
@ 2018-06-25  6:01 ` Masashi Honma
  1 sibling, 0 replies; 3+ messages in thread
From: Masashi Honma @ 2018-06-25  6:01 UTC (permalink / raw
  To: Bob Copeland; +Cc: Johannes Berg, linux-wireless, kernel-team, Bob Copeland

On 2018/06/25 10:10, Bob Copeland wrote:> The latter bit is actually 
reserved for mesh BSSes
> according to Table 9-168 in 802.11-2016, so in fact it should not
> be set.

Good catch !
Indeed the bit is reserved at non-AP case.

Reviewed-by: Masashi Honma <masashi.honma@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-25  6:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-25  1:10 [PATCH] nl80211: relax ht operation checks for mesh Bob Copeland
2018-06-25  5:54 ` Masashi Honma
2018-06-25  6:01 ` Masashi Honma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.