From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <linux-wireless@vger.kernel.org>, <ath6kl-devel@qca.qualcomm.com>
Subject: Re: ath6kl: move ath6kl_wmi_startscan_cmd()
Date: Sun, 10 Mar 2013 07:56:34 +0200 [thread overview]
Message-ID: <87620zlrvx.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <20121127072531.GB8239@elgon.mountain> (Dan Carpenter's message of "Tue, 27 Nov 2012 10:25:32 +0300")
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
prev parent reply other threads:[~2013-03-10 5:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87620zlrvx.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@qca.qualcomm.com \
--cc=ath6kl-devel@qca.qualcomm.com \
--cc=dan.carpenter@oracle.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.