linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org, Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 14/17] iwlwifi: make sure cur_fw_img is valid before accessing img
Date: Fri, 25 Jan 2019 22:13:02 +0200	[thread overview]
Message-ID: <20190125201305.5616-15-luca@coelho.fi> (raw)
In-Reply-To: <20190125201305.5616-1-luca@coelho.fi>

From: Luca Coelho <luciano.coelho@intel.com>

Harden the fwrt->fw->img array access by making sure the cur_fw_img
value doesn't go out of bounds.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/dbg.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.h b/drivers/net/wireless/intel/iwlwifi/fw/dbg.h
index d8090d4b5c43..330229d2a61d 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.h
@@ -381,6 +381,7 @@ static inline bool iwl_fw_dbg_is_paging_enabled(struct iwl_fw_runtime *fwrt)
 {
 	return iwl_fw_dbg_type_on(fwrt, IWL_FW_ERROR_DUMP_PAGING) &&
 		!fwrt->trans->cfg->gen2 &&
+		fwrt->cur_fw_img < IWL_UCODE_TYPE_MAX &&
 		fwrt->fw->img[fwrt->cur_fw_img].paging_mem_size &&
 		fwrt->fw_paging_db[0].fw_paging_block;
 }
-- 
2.20.1


  parent reply	other threads:[~2019-01-25 20:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25 20:12 [PATCH 00/17] iwlwifi: updates intended for v5.1 2019-01-25 Luca Coelho
2019-01-25 20:12 ` [PATCH 01/17] iwlwifi: pcie: fix the use of a wrong define Luca Coelho
2019-01-25 20:12 ` [PATCH 02/17] iwlwifi: iwlmvm: ignore HE PPDU type regarding EOF Luca Coelho
2019-01-25 20:12 ` [PATCH 03/17] iwlwifi: iwlmvm: in monitor NDP notif take the NSS from rx_vec Luca Coelho
2019-01-25 20:12 ` [PATCH 04/17] iwlwifi: pcie: add prints to track virtual ID Luca Coelho
2019-01-25 20:12 ` [PATCH 05/17] iwlwifi: mvm: fix %16 to %016 print format Luca Coelho
2019-01-25 20:12 ` [PATCH 06/17] iwlwifi: mvm: read IWL_RX_MPDU_PHY_SHORT_PREAMBLE only for CCK Luca Coelho
2019-01-25 20:12 ` [PATCH 07/17] iwlwifi: pcie: align licensing to dual GPL/BSD Luca Coelho
2019-01-25 20:12 ` [PATCH 08/17] iwlwifi: mvm: clean up LDBG config command usage Luca Coelho
2019-01-25 20:12 ` [PATCH 09/17] iwlwifi: mvm: save and export regdb blob from the NVM Luca Coelho
2019-01-25 20:12 ` [PATCH 10/17] iwlwifi: make iwl_fw_dbg_start_stop_hcmd() inline Luca Coelho
2019-01-25 20:12 ` [PATCH 11/17] iwlwifi: move iwl_enable_{rx,tx}_ampdu to iwl-modparams.h Luca Coelho
2019-01-25 20:13 ` [PATCH 12/17] iwlwifi: mvm: pre-initialize alive_data in wait_alive() Luca Coelho
2019-01-25 20:13 ` [PATCH 13/17] iwlwifi: calculate pointers from out_cmd instead of out_cmd->hdr Luca Coelho
2019-01-25 20:13 ` Luca Coelho [this message]
2019-01-25 20:13 ` [PATCH 15/17] iwlwifi: mvm: remove sta key on wep ap Luca Coelho
2019-01-25 20:13 ` [PATCH 16/17] iwlwifi: monitor dumping flow cleanup Luca Coelho
2019-01-25 20:13 ` [PATCH 17/17] iwlwifi: mvm: add an option to dereference vif by id Luca Coelho
2019-01-28  9:00   ` Kalle Valo
2019-01-28  9:04     ` Luca Coelho

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=20190125201305.5616-15-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@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).