linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Jia-Ju Bai <baijiaju1990@163.com>
Cc: kvalo@codeaurora.org, johannes.berg@intel.com,
	emmanuel.grumbach@intel.com, ilw@linux.intel.com,
	linuxwifi@intel.com, linux-wireless@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH v2] iwl4965: Fix a null pointer dereference in il_tx_queue_free and il_cmd_queue_free
Date: Mon, 11 Jan 2016 15:04:31 +0100	[thread overview]
Message-ID: <20160111140431.GB26139@redhat.com> (raw)
In-Reply-To: <1452519775-7049-1-git-send-email-baijiaju1990@163.com>

On Mon, Jan 11, 2016 at 09:42:54PM +0800, Jia-Ju Bai wrote:
> If "txq->cmd = kzalloc(...)" in il_tx_queue_init fails,
> "kfree(txq->cmd[i])" in il_tx_queue_free and il_cmd_queue_free
> in iwl4965_hw_txq_ctx_free will causes a null pointer dereference,
> because txq->cmd is NULL at that time.
> 
> This patch fixes this problem by adding a if-check before kfree.
> To avoid double free in il_tx_queue_free and il_cmd_queue_free
> caused by the fixing, txq->meta and txq->cmd in error handling code
> of il_tx_queue_init are assigned null values. 
> Otherwise, a double free will occur.
> 
> This patch has been tested in real device, and it actually fixes the bug.
> Thanks Stanislaw for his suggestion.
> 
> Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>

Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>


      reply	other threads:[~2016-01-11 14:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-11 13:42 [PATCH v2] iwl4965: Fix a null pointer dereference in il_tx_queue_free and il_cmd_queue_free Jia-Ju Bai
2016-01-11 14:04 ` Stanislaw Gruszka [this message]

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=20160111140431.GB26139@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=baijiaju1990@163.com \
    --cc=emmanuel.grumbach@intel.com \
    --cc=ilw@linux.intel.com \
    --cc=johannes.berg@intel.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linuxwifi@intel.com \
    --cc=netdev@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).