* re: ath6kl: move ath6kl_wmi_startscan_cmd()
@ 2012-11-27 7:25 Dan Carpenter
2013-02-06 12:09 ` Dan Carpenter
2013-03-10 5:56 ` Kalle Valo
0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2012-11-27 7:25 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
Hello Kalle Valo,
The patch c8c72b74e289: "ath6kl: move ath6kl_wmi_startscan_cmd()"
from Jul 19, 2012, leads to the following warning:
drivers/net/wireless/ath/ath6kl/wmi.c:2016 ath6kl_wmi_beginscan_cmd()
error: buffer overflow 'sc->supp_rates' 2 <= 2
drivers/net/wireless/ath/ath6kl/wmi.c
2009 for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
^^^^^^^^^^^^^^^^^^^
This is 3.
2010 sband = ar->wiphy->bands[band];
2011
2012 if (!sband)
2013 continue;
2014
2015 ratemask = rates[band];
2016 supp_rates = sc->supp_rates[band].rates;
->supp_rates has only ATH6KL_NUM_BANDS (2) elements so we are reading
one element beyond the end.
2017 num_rates = 0;
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ath6kl: move ath6kl_wmi_startscan_cmd()
2012-11-27 7:25 ath6kl: move ath6kl_wmi_startscan_cmd() Dan Carpenter
@ 2013-02-06 12:09 ` Dan Carpenter
2013-02-15 10:11 ` Kalle Valo
2013-03-10 5:56 ` Kalle Valo
1 sibling, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2013-02-06 12:09 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
Whatever happened with this?
regards,
dan carpenter
On Tue, Nov 27, 2012 at 10:25:32AM +0300, Dan Carpenter wrote:
> Hello Kalle Valo,
>
> The patch c8c72b74e289: "ath6kl: move ath6kl_wmi_startscan_cmd()"
> from Jul 19, 2012, leads to the following warning:
> drivers/net/wireless/ath/ath6kl/wmi.c:2016 ath6kl_wmi_beginscan_cmd()
> error: buffer overflow 'sc->supp_rates' 2 <= 2
>
> drivers/net/wireless/ath/ath6kl/wmi.c
>
> 2009 for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
> ^^^^^^^^^^^^^^^^^^^
> This is 3.
>
> 2010 sband = ar->wiphy->bands[band];
> 2011
> 2012 if (!sband)
> 2013 continue;
> 2014
> 2015 ratemask = rates[band];
> 2016 supp_rates = sc->supp_rates[band].rates;
>
> ->supp_rates has only ATH6KL_NUM_BANDS (2) elements so we are reading
> one element beyond the end.
>
> 2017 num_rates = 0;
>
> regards,
> dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ath6kl: move ath6kl_wmi_startscan_cmd()
2013-02-06 12:09 ` Dan Carpenter
@ 2013-02-15 10:11 ` Kalle Valo
0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2013-02-15 10:11 UTC (permalink / raw)
To: Dan Carpenter; +Cc: linux-wireless
Dan Carpenter <dan.carpenter@oracle.com> writes:
> Whatever happened with this?
It got buried inside my todo folder, sorry about that. I will look at it
soon.
--
Kalle Valo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ath6kl: move ath6kl_wmi_startscan_cmd()
2012-11-27 7:25 ath6kl: move ath6kl_wmi_startscan_cmd() Dan Carpenter
2013-02-06 12:09 ` Dan Carpenter
@ 2013-03-10 5:56 ` Kalle Valo
1 sibling, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2013-03-10 5:56 UTC (permalink / raw)
To: Dan Carpenter; +Cc: linux-wireless, ath6kl-devel
Dan Carpenter <dan.carpenter@oracle.com> writes:
> The patch c8c72b74e289: "ath6kl: move ath6kl_wmi_startscan_cmd()"
> from Jul 19, 2012, leads to the following warning:
> drivers/net/wireless/ath/ath6kl/wmi.c:2016 ath6kl_wmi_beginscan_cmd()
> error: buffer overflow 'sc->supp_rates' 2 <= 2
>
> drivers/net/wireless/ath/ath6kl/wmi.c
>
> 2009 for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
> ^^^^^^^^^^^^^^^^^^^
> This is 3.
>
> 2010 sband = ar->wiphy->bands[band];
> 2011
> 2012 if (!sband)
> 2013 continue;
> 2014
> 2015 ratemask = rates[band];
> 2016 supp_rates = sc->supp_rates[band].rates;
>
> ->supp_rates has only ATH6KL_NUM_BANDS (2) elements so we are reading
> one element beyond the end.
This shouldn't happen as only the first two bands are set in
ar->wiphy->bands so the 'if (!sband)' will cover rest of the bands. But
I want to be careful and I sent a patch which adds an extra check there.
--
Kalle Valo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-03-10 5:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-27 7:25 ath6kl: move ath6kl_wmi_startscan_cmd() Dan Carpenter
2013-02-06 12:09 ` Dan Carpenter
2013-02-15 10:11 ` Kalle Valo
2013-03-10 5:56 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox