linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfg80211: validate beacon interval for MESH/IBSS
@ 2016-08-11  9:44 Purushottam Kushwaha
  2016-08-11  9:56 ` Kushwaha, Purushottam
  0 siblings, 1 reply; 3+ messages in thread
From: Purushottam Kushwaha @ 2016-08-11  9:44 UTC (permalink / raw)
  To: johannes
  Cc: linux-wireless, jouni, usdutt, mkalikot, amarnath, djindal,
	pkushwah

Beacon interval validation was missing for MESH / IBSS join.
This commit addresses the same.

Signed-off-by: Purushottam Kushwaha <pkushwah@qti.qualcomm.com>
---
 net/wireless/nl80211.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index f02653a..ddb1469 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7780,6 +7780,10 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
 			return -EINVAL;
 	}
 
+	err = cfg80211_validate_beacon_int(rdev, ibss.beacon_interval);
+	if (err)
+		return err;
+
 	if (!rdev->ops->join_ibss)
 		return -EOPNOTSUPP;
 
@@ -9255,6 +9259,10 @@ static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info)
 		if (setup.beacon_interval < 10 ||
 		    setup.beacon_interval > 10000)
 			return -EINVAL;
+
+		err = cfg80211_validate_beacon_int(rdev, setup.beacon_interval);
+		if (err)
+			return err;
 	}
 
 	if (info->attrs[NL80211_ATTR_DTIM_PERIOD]) {
-- 
1.9.1


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

* RE: [PATCH] cfg80211: validate beacon interval for MESH/IBSS
  2016-08-11  9:44 [PATCH] cfg80211: validate beacon interval for MESH/IBSS Purushottam Kushwaha
@ 2016-08-11  9:56 ` Kushwaha, Purushottam
  2016-08-11 12:52   ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Kushwaha, Purushottam @ 2016-08-11  9:56 UTC (permalink / raw)
  To: johannes@sipsolutions.net
  Cc: linux-wireless@vger.kernel.org, Malinen, Jouni,
	Undekari, Sunil Dutt, Kalikot Veetil, Mahesh Kumar,
	Hullur Subramanyam, Amarnath, Kumar, Deepak (QCA)

Johannes , 
While addressing this change, we could notice that the minimum boundary for beacon interval for the case of IBSS is 1 but for Mesh it is 10. Also this check is not done for AP/P2P GO . 
Any reason why there is a discrepancy among them ? These configurations should be aligned , I guess. 
Shouldn't the minimum value be 10 ? If yes , the boundary check should be moved to cfg80211_validate_beacon_int ? 

Thanks,
Purushottam


-----Original Message-----
From: Kushwaha, Purushottam 
Sent: Thursday, August 11, 2016 3:14 PM
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org; Malinen, Jouni <jouni@qca.qualcomm.com>; Undekari, Sunil Dutt <usdutt@qti.qualcomm.com>; Kalikot Veetil, Mahesh Kumar <mkalikot@qca.qualcomm.com>; Hullur Subramanyam, Amarnath <amarnath@qca.qualcomm.com>; Kumar, Deepak (QCA) <djindal@qti.qualcomm.com>; Kushwaha, Purushottam <pkushwah@qti.qualcomm.com>
Subject: [PATCH] cfg80211: validate beacon interval for MESH/IBSS

Beacon interval validation was missing for MESH / IBSS join.
This commit addresses the same.

Signed-off-by: Purushottam Kushwaha <pkushwah@qti.qualcomm.com>
---
 net/wireless/nl80211.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index f02653a..ddb1469 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7780,6 +7780,10 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
 			return -EINVAL;
 	}
 
+	err = cfg80211_validate_beacon_int(rdev, ibss.beacon_interval);
+	if (err)
+		return err;
+
 	if (!rdev->ops->join_ibss)
 		return -EOPNOTSUPP;
 
@@ -9255,6 +9259,10 @@ static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info)
 		if (setup.beacon_interval < 10 ||
 		    setup.beacon_interval > 10000)
 			return -EINVAL;
+
+		err = cfg80211_validate_beacon_int(rdev, setup.beacon_interval);
+		if (err)
+			return err;
 	}
 
 	if (info->attrs[NL80211_ATTR_DTIM_PERIOD]) {
--
1.9.1


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

* Re: [PATCH] cfg80211: validate beacon interval for MESH/IBSS
  2016-08-11  9:56 ` Kushwaha, Purushottam
@ 2016-08-11 12:52   ` Johannes Berg
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2016-08-11 12:52 UTC (permalink / raw)
  To: Kushwaha, Purushottam
  Cc: linux-wireless@vger.kernel.org, Malinen, Jouni,
	Undekari, Sunil Dutt, Kalikot Veetil, Mahesh Kumar,
	Hullur Subramanyam, Amarnath, Kumar, Deepak (QCA)

On Thu, 2016-08-11 at 09:56 +0000, Kushwaha, Purushottam wrote:
> Johannes , 
> While addressing this change, we could notice that the minimum
> boundary for beacon interval for the case of IBSS is 1 but for Mesh
> it is 10. Also this check is not done for AP/P2P GO . 
> Any reason why there is a discrepancy among them ? These
> configurations should be aligned , I guess. 
> Shouldn't the minimum value be 10 ? If yes , the boundary check
> should be moved to cfg80211_validate_beacon_int ? 
> 

Yeah, I've applied the patch and moved the range checks in as well.

johannes

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

end of thread, other threads:[~2016-08-11 13:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-11  9:44 [PATCH] cfg80211: validate beacon interval for MESH/IBSS Purushottam Kushwaha
2016-08-11  9:56 ` Kushwaha, Purushottam
2016-08-11 12:52   ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).