ATH10K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: kbuild@01.org, Sriram R <srirrama@codeaurora.org>,
	ath10k@lists.infradead.org, kbuild-all@01.org
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: Mon, 24 Sep 2018 14:09:46 +0300	[thread overview]
Message-ID: <87h8if40ed.fsf@codeaurora.org> (raw)
In-Reply-To: <20180922123828.7ajnxyhvkyajntv7@mwanda> (Dan Carpenter's message of "Sat, 22 Sep 2018 15:38:28 +0300")

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?

-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

  reply	other threads:[~2018-09-24 11:10 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 [this message]
2018-09-25  5:50   ` Sriram R

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=87h8if40ed.fsf@codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=ath10k@lists.infradead.org \
    --cc=dan.carpenter@oracle.com \
    --cc=kbuild-all@01.org \
    --cc=kbuild@01.org \
    --cc=srirrama@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