All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Eddie Wai <eddie.wai@broadcom.com>
Cc: James Bottomley <jbottomley@parallels.com>,
	open-iscsi <open-iscsi@googlegroups.com>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	Michael Chan <mchan@broadcom.com>,
	Anil Veerabhadrappa <anilgv@broadcom.com>,
	Ben Li <benli@broadcom.com>
Subject: Re: [PATCH] BNX2I: Fixed kernel panic caused by unprotected task->sc->request deref
Date: Wed, 07 Dec 2011 13:50:30 -0600	[thread overview]
Message-ID: <4EDFC386.9060708@cs.wisc.edu> (raw)
In-Reply-To: <1323240081-5328-1-git-send-email-eddie.wai@broadcom.com>

On 12/07/2011 12:41 AM, Eddie Wai wrote:
> During session recovery, the conn_stop call will trigger a flush
> to all outstanding SCSI cmds in the xmit queue.  This will set
> all outstanding task->sc to NULL prior to the session_teardown
> call which frees the task memory.
> 
> In the bnx2i SCSI response processing path, only the task was being checked
> for NULL under the session lock before the task->sc->request dereferencing.
> If there are outstanding SCSI cmd responses pending for process, the
> following kernel panic can be exposed where task->sc was found to be NULL.
> 
>  Call Trace:
> [   69.720205]  [<ffffffffa040d0d0>] bnx2i_process_new_cqes+0x290/0x3c0 [bnx2i]
> [   69.804289]  [<ffffffffa040d233>] bnx2i_fastpath_notification+0x33/0xa0 [bnx2
> i]
> [   69.891490]  [<ffffffffa040d37b>] bnx2i_indicate_kcqe+0xdb/0x330 [bnx2i]
> [   69.971427]  [<ffffffffa03eac5e>] service_kcqes+0x16e/0x1d0 [cnic]
> [   70.045132]  [<ffffffffa03eacea>] cnic_service_bnx2x_kcq+0x2a/0x50 [cnic]
> [   70.126105]  [<ffffffffa03ead53>] cnic_service_bnx2x_bh+0x43/0x140 [cnic]
> [   70.207081]  [<ffffffff81060676>] tasklet_action+0x66/0x110
> [   70.273521]  [<ffffffff8106025f>] __do_softirq+0xef/0x220
> [   70.337887]  [<ffffffff81447ebc>] call_softirq+0x1c/0x30
> 
> This patch adds the !task->sc check and also protects the sc dereferencing
> under the session lock.
> 
> Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
> ---


Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>

      reply	other threads:[~2011-12-07 19:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-07  6:41 [PATCH] BNX2I: Fixed kernel panic caused by unprotected task->sc->request deref Eddie Wai
2011-12-07 19:50 ` Mike Christie [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=4EDFC386.9060708@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=anilgv@broadcom.com \
    --cc=benli@broadcom.com \
    --cc=eddie.wai@broadcom.com \
    --cc=jbottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mchan@broadcom.com \
    --cc=open-iscsi@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.