提交 1cd8e88e 编写于 作者: J Johannes Berg

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: NJohannes Berg <johannes.berg@intel.com>
上级 a6dfba84
...@@ -463,7 +463,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, ...@@ -463,7 +463,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
struct ieee80211_supported_band *sband = local->hw.wiphy->bands[band]; struct ieee80211_supported_band *sband = local->hw.wiphy->bands[band];
bool rates_updated = false; bool rates_updated = false;
if (elems->ds_params && elems->ds_params_len == 1) if (elems->ds_params)
freq = ieee80211_channel_to_frequency(elems->ds_params[0], freq = ieee80211_channel_to_frequency(elems->ds_params[0],
band); band);
else else
......
...@@ -1186,7 +1186,6 @@ struct ieee802_11_elems { ...@@ -1186,7 +1186,6 @@ struct ieee802_11_elems {
/* length of them, respectively */ /* length of them, respectively */
u8 ssid_len; u8 ssid_len;
u8 supp_rates_len; u8 supp_rates_len;
u8 ds_params_len;
u8 tim_len; u8 tim_len;
u8 challenge_len; u8 challenge_len;
u8 rsn_len; u8 rsn_len;
......
...@@ -907,7 +907,7 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, ...@@ -907,7 +907,7 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
(!elems.rsn && sdata->u.mesh.security != IEEE80211_MESH_SEC_NONE)) (!elems.rsn && sdata->u.mesh.security != IEEE80211_MESH_SEC_NONE))
return; return;
if (elems.ds_params && elems.ds_params_len == 1) if (elems.ds_params)
freq = ieee80211_channel_to_frequency(elems.ds_params[0], band); freq = ieee80211_channel_to_frequency(elems.ds_params[0], band);
else else
freq = rx_status->freq; freq = rx_status->freq;
......
...@@ -2695,7 +2695,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, ...@@ -2695,7 +2695,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
} }
} }
if (elems->ds_params && elems->ds_params_len == 1) if (elems->ds_params)
freq = ieee80211_channel_to_frequency(elems->ds_params[0], freq = ieee80211_channel_to_frequency(elems->ds_params[0],
rx_status->band); rx_status->band);
else else
......
...@@ -739,8 +739,10 @@ u32 ieee802_11_parse_elems_crc(u8 *start, size_t len, ...@@ -739,8 +739,10 @@ u32 ieee802_11_parse_elems_crc(u8 *start, size_t len,
elems->supp_rates_len = elen; elems->supp_rates_len = elen;
break; break;
case WLAN_EID_DS_PARAMS: case WLAN_EID_DS_PARAMS:
if (elen >= 1)
elems->ds_params = pos; elems->ds_params = pos;
elems->ds_params_len = elen; else
elem_parse_failed = true;
break; break;
case WLAN_EID_TIM: case WLAN_EID_TIM:
if (elen >= sizeof(struct ieee80211_tim_ie)) { if (elen >= sizeof(struct ieee80211_tim_ie)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册