iwlwifi: range checking issue
PATCH 1/1 iwlwifi: range checking issue
IWL_RATE_COUNT is 13 and IWL_RATE_COUNT_LEGACY is 12.
IWL_RATE_COUNT_LEGACY is the right one here because iwl3945_rates doesn't support 60M and also that's how "rates" is defined in iwlcore_init_geos() from drivers/net/wireless/iwlwifi/iwl-core.c.
rates = kzalloc((sizeof(struct ieee80211_rate) * IWL_RATE_COUNT_LEGACY),
GFP_KERNEL);
drivers/net/wireless/iwlwifi/iwl3945-base.c +1 -1
@@ -1955,7 +1955,7 @@ static void iwl3945_init_hw_rates(struct iwl_priv *priv, {int i; -for (i =0 ; i <IWL_RATE_COUNT ; i++) { +for (i =0 ; i <IWL_RATE_COUNT_LEGACY ; i++) { rates[i].bitrate = iwl3945_rates[i].ieee *5 ; rates[i].hw_value = i;/* Rate scaling will work on indexes */ rates[i].hw_value_short = i;
Quoted 10 lines · Dan Carpenter
IWL_RATE_COUNTis 13 andIWL_RATE_COUNT_LEGACYis 12.
IWL_RATE_COUNT_LEGACYis the right one here becauseiwl3945_ratesdoesn't support 60M and also that's how "rates" is defined iniwlcore_init_geos()fromdrivers/net/wireless/iwlwifi/iwl-core.c.rates = kzalloc((sizeof(struct
ieee80211_rate) *IWL_RATE_COUNT_LEGACY),
GFP_KERNEL);Signed-off-by Dan Carpenter <[email protected]>
Thanks,
-yi
Quoted 7 lines · Yi
Quoted 6 lines · Dan Carpenter
IWL_RATE_COUNTis 13 andIWL_RATE_COUNT_LEGACYis 12.
IWL_RATE_COUNT_LEGACYis the right one here becauseiwl3945_ratesdoesn't support 60M and also that's how "rates" is defined iniwlcore_init_geos()fromdrivers/net/wireless/iwlwifi/iwl-core.c.
Quoted 6 lines
Quoted 4 lines
rates = kzalloc((sizeof(struct
ieee80211_rate) *IWL_RATE_COUNT_LEGACY),
GFP_KERNEL);Signed-off-by Dan Carpenter <[email protected]>Acked-by Zhu Yi <[email protected]>
Great catch. Since this is a fix for a buffer overflow ... could you please pass it on to stable also?
Thank you
Reinette