linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
To: linux-wireless@vger.kernel.org
Cc: Eliad Peller <eliad@wizery.com>,
	Eliad Peller <eliadx.peller@intel.com>,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH 10/10] iwlwifi: mvm: avoid use-after-free on iwl_mvm_d0i3_enable_tx()
Date: Thu, 21 May 2015 22:53:10 +0300	[thread overview]
Message-ID: <1432237990-5890-10-git-send-email-emmanuel.grumbach@intel.com> (raw)
In-Reply-To: <1432237819.26813.4.camel@intel.com>

From: Eliad Peller <eliad@wizery.com>

qos_seq points (to a struct) inside the command response data.

Make sure to free the response only after qos_seq is not
needed anymore.

Reported-by: Heng Luo <heng.luo@intel.com>
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/mvm/ops.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/mvm/ops.c b/drivers/net/wireless/iwlwifi/mvm/ops.c
index 1c66297..2ea0123 100644
--- a/drivers/net/wireless/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/iwlwifi/mvm/ops.c
@@ -1263,11 +1263,13 @@ static void iwl_mvm_d0i3_exit_work(struct work_struct *wk)
 		ieee80211_iterate_active_interfaces(
 			mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
 			iwl_mvm_d0i3_disconnect_iter, mvm);
-
-	iwl_free_resp(&get_status_cmd);
 out:
 	iwl_mvm_d0i3_enable_tx(mvm, qos_seq);
 
+	/* qos_seq might point inside resp_pkt, so free it only now */
+	if (get_status_cmd.resp_pkt)
+		iwl_free_resp(&get_status_cmd);
+
 	/* the FW might have updated the regdomain */
 	iwl_mvm_update_changed_regdom(mvm);
 
-- 
2.1.4


  parent reply	other threads:[~2015-05-21 19:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21 19:50 pull request: iwlwifi 2015-05-21 Grumbach, Emmanuel
2015-05-21 19:53 ` [PATCH 01/10] iwlwifi: mvm: forbid MIMO on devices that don't support it Emmanuel Grumbach
2015-05-21 19:53 ` [PATCH 02/10] iwlwifi: 7000: modify the firmware name for 3165 Emmanuel Grumbach
2015-05-21 19:53 ` [PATCH 03/10] iwlwifi: pcie: don't disable the busmaster DMA clock for family 8000 Emmanuel Grumbach
2015-05-21 19:53 ` [PATCH 04/10] iwlwifi: mvm: fix MLME trigger Emmanuel Grumbach
2015-05-21 19:53 ` [PATCH 05/10] iwlwifi: mvm: Free fw_status after use to avoid memory leak Emmanuel Grumbach
2015-05-21 19:53 ` [PATCH 06/10] iwlwifi: nvm: force mac from otp in case nvm mac is reserved Emmanuel Grumbach
2015-05-21 19:53 ` [PATCH 07/10] iwlwifi: mvm: BT Coex - duplicate the command if sent ASYNC Emmanuel Grumbach
2015-05-21 19:53 ` [PATCH 08/10] iwlwifi: mvm: take the UCODE_DOWN reference when resuming Emmanuel Grumbach
2015-05-21 19:53 ` [PATCH 09/10] iwlwifi: mvm: clean net-detect info if device was reset during suspend Emmanuel Grumbach
2015-05-21 19:53 ` Emmanuel Grumbach [this message]
2015-05-22  8:00 ` pull request: iwlwifi 2015-05-21 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=1432237990-5890-10-git-send-email-emmanuel.grumbach@intel.com \
    --to=emmanuel.grumbach@intel.com \
    --cc=eliad@wizery.com \
    --cc=eliadx.peller@intel.com \
    --cc=linux-wireless@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;
as well as URLs for NNTP newsgroup(s).