aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-03-27 09:30:12 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-04-08 03:16:56 -0400
commit1cd8e88e17729f57a9c7f751103e522596bb5de2 (patch)
treec20e4a7bed65480cea84f6a38bb4d0d44dd115f0 /net
parenta6dfba841c4d38312115dc6b08d86cc496af7e88 (diff)
mac80211: check DSSS params IE length in parser
It's always just one byte, so check for that and remove the length field from the parser struct. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/ibss.c2
-rw-r--r--net/mac80211/ieee80211_i.h1
-rw-r--r--net/mac80211/mesh.c2
-rw-r--r--net/mac80211/mlme.c2
-rw-r--r--net/mac80211/util.c6
5 files changed, 7 insertions, 6 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 5ab32e2a7b56..2a0b2186d98f 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -463,7 +463,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
463 struct ieee80211_supported_band *sband = local->hw.wiphy->bands[band]; 463 struct ieee80211_supported_band *sband = local->hw.wiphy->bands[band];
464 bool rates_updated = false; 464 bool rates_updated = false;
465 465
466 if (elems->ds_params && elems->ds_params_len == 1) 466 if (elems->ds_params)
467 freq = ieee80211_channel_to_frequency(elems->ds_params[0], 467 freq = ieee80211_channel_to_frequency(elems->ds_params[0],
468 band); 468 band);
469 else 469 else
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index bb4bfe43bf40..eccd1d805ecc 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1186,7 +1186,6 @@ struct ieee802_11_elems {
1186 /* length of them, respectively */ 1186 /* length of them, respectively */
1187 u8 ssid_len; 1187 u8 ssid_len;
1188 u8 supp_rates_len; 1188 u8 supp_rates_len;
1189 u8 ds_params_len;
1190 u8 tim_len; 1189 u8 tim_len;
1191 u8 challenge_len; 1190 u8 challenge_len;
1192 u8 rsn_len; 1191 u8 rsn_len;
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index aead5410c622..0acc2874d294 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -907,7 +907,7 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
907 (!elems.rsn && sdata->u.mesh.security != IEEE80211_MESH_SEC_NONE)) 907 (!elems.rsn && sdata->u.mesh.security != IEEE80211_MESH_SEC_NONE))
908 return; 908 return;
909 909
910 if (elems.ds_params && elems.ds_params_len == 1) 910 if (elems.ds_params)
911 freq = ieee80211_channel_to_frequency(elems.ds_params[0], band); 911 freq = ieee80211_channel_to_frequency(elems.ds_params[0], band);
912 else 912 else
913 freq = rx_status->freq; 913 freq = rx_status->freq;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index e12fedcfa988..f76c58fb3bdc 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2695,7 +2695,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
2695 } 2695 }
2696 } 2696 }
2697 2697
2698 if (elems->ds_params && elems->ds_params_len == 1) 2698 if (elems->ds_params)
2699 freq = ieee80211_channel_to_frequency(elems->ds_params[0], 2699 freq = ieee80211_channel_to_frequency(elems->ds_params[0],
2700 rx_status->band); 2700 rx_status->band);
2701 else 2701 else
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 2708b270e944..0f7d1c20f8ac 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -739,8 +739,10 @@ u32 ieee802_11_parse_elems_crc(u8 *start, size_t len,
739 elems->supp_rates_len = elen; 739 elems->supp_rates_len = elen;
740 break; 740 break;
741 case WLAN_EID_DS_PARAMS: 741 case WLAN_EID_DS_PARAMS:
742 elems->ds_params = pos; 742 if (elen >= 1)
743 elems->ds_params_len = elen; 743 elems->ds_params = pos;
744 else
745 elem_parse_failed = true;
744 break; 746 break;
745 case WLAN_EID_TIM: 747 case WLAN_EID_TIM:
746 if (elen >= sizeof(struct ieee80211_tim_ie)) { 748 if (elen >= sizeof(struct ieee80211_tim_ie)) {