public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Avraham Stern <avraham.stern@intel.com>,
	Miri Korenblit <miriam.rachel.korenblit@intel.com>,
	Johannes Berg <johannes.berg@intel.com>,
	Sasha Levin <sashal@kernel.org>,
	gregory.greenman@intel.com, kvalo@kernel.org,
	benjamin.berg@intel.com, ansuelsmth@gmail.com,
	pagadala.yesu.anjaneyulu@intel.com,
	linux-wireless@vger.kernel.org
Subject: [PATCH AUTOSEL 5.15 07/11] wifi: iwlwifi: pcie: avoid a NULL pointer dereference
Date: Mon, 25 Dec 2023 19:23:56 -0500	[thread overview]
Message-ID: <20231226002420.6303-7-sashal@kernel.org> (raw)
In-Reply-To: <20231226002420.6303-1-sashal@kernel.org>

From: Avraham Stern <avraham.stern@intel.com>

[ Upstream commit ce038edfce43fb345f8dfdca0f7b17f535896701 ]

It possible that while the rx rb is being handled, the transport has
been stopped and re-started. In this case the tx queue pointer is not
yet initialized, which will lead to a NULL pointer dereference.
Fix it.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20231207044813.cd0898cafd89.I0b84daae753ba9612092bf383f5c6f761446e964@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
index df201d40f6c95..92f14ea13a573 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
@@ -1380,7 +1380,7 @@ static void iwl_pcie_rx_handle_rb(struct iwl_trans *trans,
 		 * if it is true then one of the handlers took the page.
 		 */
 
-		if (reclaim) {
+		if (reclaim && txq) {
 			u16 sequence = le16_to_cpu(pkt->hdr.sequence);
 			int index = SEQ_TO_INDEX(sequence);
 			int cmd_index = iwl_txq_get_cmd_index(txq, index);
-- 
2.43.0


  parent reply	other threads:[~2023-12-26  0:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-26  0:23 [PATCH AUTOSEL 5.15 01/11] reset: hisilicon: hi6220: fix Wvoid-pointer-to-enum-cast warning Sasha Levin
2023-12-26  0:23 ` [PATCH AUTOSEL 5.15 02/11] Input: atkbd - skip ATKBD_CMD_GETID in translated mode Sasha Levin
2023-12-26  0:23 ` [PATCH AUTOSEL 5.15 03/11] Input: i8042 - add nomux quirk for Acer P459-G2-M Sasha Levin
2023-12-26  0:23 ` [PATCH AUTOSEL 5.15 04/11] Input: amimouse - convert to platform remove callback returning void Sasha Levin
2023-12-26  0:23 ` [PATCH AUTOSEL 5.15 05/11] s390/scm: fix virtual vs physical address confusion Sasha Levin
2023-12-26  0:23 ` [PATCH AUTOSEL 5.15 06/11] ARC: fix spare error Sasha Levin
2023-12-26  0:23 ` Sasha Levin [this message]
2023-12-26  0:23 ` [PATCH AUTOSEL 5.15 08/11] Input: xpad - add Razer Wolverine V2 support Sasha Levin
2023-12-26  0:23 ` [PATCH AUTOSEL 5.15 09/11] ASoC: Intel: bytcr_rt5640: Add quirk for the Medion Lifetab S10346 Sasha Levin
2023-12-26  0:23 ` [PATCH AUTOSEL 5.15 10/11] i2c: rk3x: fix potential spinlock recursion on poll Sasha Levin
2023-12-26  0:24 ` [PATCH AUTOSEL 5.15 11/11] ida: Fix crash in ida_free when the bitmap is empty Sasha Levin

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=20231226002420.6303-7-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=ansuelsmth@gmail.com \
    --cc=avraham.stern@intel.com \
    --cc=benjamin.berg@intel.com \
    --cc=gregory.greenman@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=miriam.rachel.korenblit@intel.com \
    --cc=pagadala.yesu.anjaneyulu@intel.com \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox