linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mac80211: check for mesh_config length on incoming management frames
@ 2008-03-31 23:00 Luis Carlos Cobo
  2008-04-01 11:59 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Luis Carlos Cobo @ 2008-03-31 23:00 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes


Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com>
---
 net/mac80211/ieee80211_sta.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index cfe6fcc..feec201 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -2153,11 +2153,14 @@ ieee80211_rx_mesh_bss_get(struct net_device *dev, u8 *mesh_id, int mesh_id_len,
 
 static struct ieee80211_sta_bss *
 ieee80211_rx_mesh_bss_add(struct net_device *dev, u8 *mesh_id, int mesh_id_len,
-			  u8 *mesh_cfg, int freq)
+			  u8 *mesh_cfg, int mesh_config_len, int freq)
 {
 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
 	struct ieee80211_sta_bss *bss;
 
+	if (mesh_config_len != MESH_CFG_LEN)
+		return NULL;
+
 	bss = kzalloc(sizeof(*bss), GFP_ATOMIC);
 	if (!bss)
 		return NULL;
@@ -2530,7 +2533,8 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
 #ifdef CONFIG_MAC80211_MESH
 		if (elems.mesh_config)
 			bss = ieee80211_rx_mesh_bss_add(dev, elems.mesh_id,
-				elems.mesh_id_len, elems.mesh_config, freq);
+				elems.mesh_id_len, elems.mesh_config,
+				elems.mesh_config_len, freq);
 		else
 #endif
 			bss = ieee80211_rx_bss_add(dev, mgmt->bssid, freq,
-- 
1.5.4.3




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

* Re: [PATCH 1/2] mac80211: check for mesh_config length on incoming management frames
  2008-03-31 23:00 [PATCH 1/2] mac80211: check for mesh_config length on incoming management frames Luis Carlos Cobo
@ 2008-04-01 11:59 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2008-04-01 11:59 UTC (permalink / raw)
  To: Luis Carlos Cobo; +Cc: linux-wireless, John Linville

[-- Attachment #1: Type: text/plain, Size: 1368 bytes --]


Indeed :)
Acked-by: Johannes Berg <johannes@sipsolutions.net>

> ---
>  net/mac80211/ieee80211_sta.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
> index cfe6fcc..feec201 100644
> --- a/net/mac80211/ieee80211_sta.c
> +++ b/net/mac80211/ieee80211_sta.c
> @@ -2153,11 +2153,14 @@ ieee80211_rx_mesh_bss_get(struct net_device *dev, u8 *mesh_id, int mesh_id_len,
>  
>  static struct ieee80211_sta_bss *
>  ieee80211_rx_mesh_bss_add(struct net_device *dev, u8 *mesh_id, int mesh_id_len,
> -			  u8 *mesh_cfg, int freq)
> +			  u8 *mesh_cfg, int mesh_config_len, int freq)
>  {
>  	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
>  	struct ieee80211_sta_bss *bss;
>  
> +	if (mesh_config_len != MESH_CFG_LEN)
> +		return NULL;
> +
>  	bss = kzalloc(sizeof(*bss), GFP_ATOMIC);
>  	if (!bss)
>  		return NULL;
> @@ -2530,7 +2533,8 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
>  #ifdef CONFIG_MAC80211_MESH
>  		if (elems.mesh_config)
>  			bss = ieee80211_rx_mesh_bss_add(dev, elems.mesh_id,
> -				elems.mesh_id_len, elems.mesh_config, freq);
> +				elems.mesh_id_len, elems.mesh_config,
> +				elems.mesh_config_len, freq);
>  		else
>  #endif
>  			bss = ieee80211_rx_bss_add(dev, mgmt->bssid, freq,

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

end of thread, other threads:[~2008-04-01 11:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-31 23:00 [PATCH 1/2] mac80211: check for mesh_config length on incoming management frames Luis Carlos Cobo
2008-04-01 11:59 ` 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).