linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Coelho, Luciano" <luciano.coelho@intel.com>
To: "dan.carpenter@oracle.com" <dan.carpenter@oracle.com>,
	"Berg, Johannes" <johannes.berg@intel.com>
Cc: "kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>,
	"Goldstein, Naftali" <naftali.goldstein@intel.com>,
	"kvalo@codeaurora.org" <kvalo@codeaurora.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"Goodstein, Mordechay" <mordechay.goodstein@intel.com>,
	"Sharon, Sara" <sara.sharon@intel.com>,
	"Grumbach, Emmanuel" <emmanuel.grumbach@intel.com>,
	"Dan1.Halperin@intel.com" <Dan1.Halperin@intel.com>
Subject: Re: [PATCH 1/2] iwlwifi: mvm: d3: Fix off by ones in iwl_mvm_wowlan_get_rsc_v5_data()
Date: Fri, 17 Sep 2021 06:23:34 +0000	[thread overview]
Message-ID: <2fc3e84bcc5490212ed86566957e19340520ac37.camel@intel.com> (raw)
In-Reply-To: <20210831081802.GA9846@kili>

On Tue, 2021-08-31 at 11:18 +0300, Dan Carpenter wrote:
> These should be >= ARRAY_SIZE() instead of > ARRAY_SIZE() to prevent an
> out of bounds write on the next line.
> 
> Fixes: 79e561f0f05a ("iwlwifi: mvm: d3: implement RSC command version 5")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
> index 0e97d5e6c644..6e3a63a5a75c 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
> @@ -360,11 +360,11 @@ static void iwl_mvm_wowlan_get_rsc_v5_data(struct ieee80211_hw *hw,
>  	if (sta) {
>  		rsc = data->rsc->ucast_rsc;
>  	} else {
> -		if (WARN_ON(data->gtks > ARRAY_SIZE(data->gtk_ids)))
> +		if (WARN_ON(data->gtks >= ARRAY_SIZE(data->gtk_ids)))
>  			return;
>  		data->gtk_ids[data->gtks] = key->keyidx;
>  		rsc = data->rsc->mcast_rsc[data->gtks % 2];
> -		if (WARN_ON(key->keyidx >
> +		if (WARN_ON(key->keyidx >=
>  				ARRAY_SIZE(data->rsc->mcast_key_id_map)))
>  			return;
>  		data->rsc->mcast_key_id_map[key->keyidx] = data->gtks % 2;

Thanks!

Acked-by: Luca Coelho <luca@coelho.fi>

--
Cheers,
Luca.

  parent reply	other threads:[~2021-09-17  6:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31  8:18 [PATCH 1/2] iwlwifi: mvm: d3: Fix off by ones in iwl_mvm_wowlan_get_rsc_v5_data() Dan Carpenter
2021-08-31  8:18 ` [PATCH 2/2] iwlwifi: mvm: d3: missing unlock in iwl_mvm_wowlan_program_keys() Dan Carpenter
2021-09-17  6:24   ` Coelho, Luciano
2021-09-16 17:05 ` [PATCH 1/2] iwlwifi: mvm: d3: Fix off by ones in iwl_mvm_wowlan_get_rsc_v5_data() Kalle Valo
2021-09-17  6:25   ` Coelho, Luciano
2021-09-17  6:23 ` Coelho, Luciano [this message]
2021-09-19 14:34 ` Kalle Valo

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=2fc3e84bcc5490212ed86566957e19340520ac37.camel@intel.com \
    --to=luciano.coelho@intel.com \
    --cc=Dan1.Halperin@intel.com \
    --cc=dan.carpenter@oracle.com \
    --cc=emmanuel.grumbach@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mordechay.goodstein@intel.com \
    --cc=naftali.goldstein@intel.com \
    --cc=sara.sharon@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).