From: Sriram R <srirrama@codeaurora.org>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: ath10k@lists.infradead.org, kbuild@01.org, kbuild-all@01.org,
Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [ath6kl:pending 39/55] drivers/net/wireless/ath/ath10k/mac.c:169 ath10k_mac_get_rate_hw_value() error: buffer overflow 'ath10k_rates' 12 <= 143
Date: Tue, 25 Sep 2018 11:20:02 +0530 [thread overview]
Message-ID: <ef5d3903cf09f8503e9c4ed9f05c6b5f@codeaurora.org> (raw)
In-Reply-To: <87h8if40ed.fsf@codeaurora.org>
On 2018-09-24 16:39, Kalle Valo wrote:
> Dan Carpenter <dan.carpenter@oracle.com> writes:
>
>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
>> pending
>> head: 2305dc3c6b1d66a7bef752439919d61478e02893
>> commit: 0c737c78082055ff589f6683e93b45f079c5d64e [39/55] ath10k: Add
>> support for configuring management packet rate
>>
>> New smatch warnings:
>> drivers/net/wireless/ath/ath10k/mac.c:169
>> ath10k_mac_get_rate_hw_value() error: buffer overflow 'ath10k_rates'
>> 12 <= 143
>>
>> Old smatch warnings:
>> drivers/net/wireless/ath/ath10k/mac.c:170
>> ath10k_mac_get_rate_hw_value() error: buffer overflow 'ath10k_rates'
>> 12 <= 143
>>
>> #
>> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?id=0c737c78082055ff589f6683e93b45f079c5d64e
>> git remote add ath6kl
>> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
>> git remote update ath6kl
>> git checkout 0c737c78082055ff589f6683e93b45f079c5d64e
>> vim +/ath10k_rates +169 drivers/net/wireless/ath/ath10k/mac.c
>>
>> 01cebe1c Michal Kazior 2015-03-30 159
>> 0c737c78 Sriram R 2018-09-10 160 static int
>> ath10k_mac_get_rate_hw_value(int bitrate)
>> 0c737c78 Sriram R 2018-09-10 161 {
>> 0c737c78 Sriram R 2018-09-10 162 int i;
>> 0c737c78 Sriram R 2018-09-10 163 u8 hw_value_prefix = 0;
>> 0c737c78 Sriram R 2018-09-10 164
>> 0c737c78 Sriram R 2018-09-10 165 if
>> (ath10k_mac_bitrate_is_cck(bitrate))
>> 0c737c78 Sriram R 2018-09-10 166 hw_value_prefix =
>> WMI_RATE_PREAMBLE_CCK << 6;
>> 0c737c78 Sriram R 2018-09-10 167
>> 0c737c78 Sriram R 2018-09-10 168 for (i = 0; i <
>> sizeof(ath10k_rates); i++) {
>>
>> ^^^^^^^^^^^^^^^^^^^^
>> This should be ARRAY_SIZE(ath10k_rates) instead of sizeof().
>
> Makes sense. Can someone submit a patch, please?
Hi Kalle, I've sent a v2 Patch with this change.
Thanks,
Sriram.R
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
prev parent reply other threads:[~2018-09-25 5:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-22 12:38 [ath6kl:pending 39/55] drivers/net/wireless/ath/ath10k/mac.c:169 ath10k_mac_get_rate_hw_value() error: buffer overflow 'ath10k_rates' 12 <= 143 Dan Carpenter
2018-09-24 11:09 ` Kalle Valo
2018-09-25 5:50 ` Sriram R [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=ef5d3903cf09f8503e9c4ed9f05c6b5f@codeaurora.org \
--to=srirrama@codeaurora.org \
--cc=ath10k@lists.infradead.org \
--cc=dan.carpenter@oracle.com \
--cc=kbuild-all@01.org \
--cc=kbuild@01.org \
--cc=kvalo@codeaurora.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox