All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] cfg80211: Validate legacy rateset.
@ 2012-04-20 12:13 Bala Shanmugam
  2012-04-20 12:26 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Bala Shanmugam @ 2012-04-20 12:13 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Bala Shanmugam

Legacy rates are not validated while configuring
tx rateset using iw. So below cmd is accepted by nl80211.
sudo iw wlan2 set bitrates legacy-2.4 1 2 3

Validate legacy rates and return
error if any rate in the rateset is not valid.

Signed-off-by: Bala Shanmugam <bkamatch@qca.qualcomm.com>
---
 net/wireless/nl80211.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index bcf6f70..f822e7c 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5577,6 +5577,9 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
 				sband,
 				nla_data(tb[NL80211_TXRATE_LEGACY]),
 				nla_len(tb[NL80211_TXRATE_LEGACY]));
+			if (mask.control[band].legacy == 0 &&
+				nla_len(tb[NL80211_TXRATE_LEGACY]))
+				return -EINVAL;
 		}
 		if (tb[NL80211_TXRATE_MCS]) {
 			if (!ht_rateset_to_mask(
-- 
1.7.4.1


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

* Re: [PATCH v2] cfg80211: Validate legacy rateset.
  2012-04-20 12:13 [PATCH v2] cfg80211: Validate legacy rateset Bala Shanmugam
@ 2012-04-20 12:26 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2012-04-20 12:26 UTC (permalink / raw)
  To: Bala Shanmugam; +Cc: linville, linux-wireless

On Fri, 2012-04-20 at 17:43 +0530, Bala Shanmugam wrote:
> Legacy rates are not validated while configuring
> tx rateset using iw. So below cmd is accepted by nl80211.
> sudo iw wlan2 set bitrates legacy-2.4 1 2 3
> 
> Validate legacy rates and return
> error if any rate in the rateset is not valid.
> 
> Signed-off-by: Bala Shanmugam <bkamatch@qca.qualcomm.com>
> ---
>  net/wireless/nl80211.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index bcf6f70..f822e7c 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -5577,6 +5577,9 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb,
>  				sband,
>  				nla_data(tb[NL80211_TXRATE_LEGACY]),
>  				nla_len(tb[NL80211_TXRATE_LEGACY]));
> +			if (mask.control[band].legacy == 0 &&
> +				nla_len(tb[NL80211_TXRATE_LEGACY]))
> +				return -EINVAL;

Please use proper indentation.

johannes


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

end of thread, other threads:[~2012-04-20 12:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-20 12:13 [PATCH v2] cfg80211: Validate legacy rateset Bala Shanmugam
2012-04-20 12:26 ` Johannes Berg

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.