public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Bart Van Assche <bart.vanassche@gmail.com>
Cc: Roland Dreier <rdreier@cisco.com>,
	Sean Hefty <sean.hefty@intel.com>,
	Hal Rosenstock <hal.rosenstock@gmail.com>,
	OpenIB <general@lists.openfabrics.org>,
	Vladislav Bolkhovitin <vst@vlnb.net>,
	linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH 2.6.30.4] Fix for NULL pointer dereference by SRP initiator triggered by a SCSI reset after the SRP connection has been closed
Date: Wed, 05 Aug 2009 15:37:44 -0500	[thread overview]
Message-ID: <1249504664.4183.45.camel@mulgrave.site> (raw)
In-Reply-To: <e2e108260908051054r11262096j3b659de24c820967@mail.gmail.com>

On Wed, 2009-08-05 at 19:54 +0200, Bart Van Assche wrote:
> On Wed, Aug 5, 2009 at 7:44 PM, Roland Dreier<rdreier@cisco.com> wrote:
> >
> >  > The NULL pointer dereference happens when srp_reset_device() calls
> >  > srp_send_tsk_mgmt(target, req, SRP_TSK_LUN_RESET) with
> >  > req->scmnd->device == NULL. When the sg_reset command issues an
> >  > SG_SCSI_RESET ioctl, scsi_reset_provider() is invoked and allocates an
> >  > scmnd structure and sets scmnd->device to NULL. It is this scmnd
> >  > structure that is passed to srp_reset_device(). What I'm not sure
> >  > about is whether scsi_reset_provider() should set req->scmnd->device
> >  > to a non-NULL value or whether srp_send_tsk_mgmt() should be able to
> >  > handle the condition req->scmnd->device == NULL.
> >
> > Well, I don't see how the reset ioctl can do anything useful unless it
> > passes a device in with the scsi command -- otherwise for example
> > srp_reset_device() has no idea what LUN to try and reset.
> 
> (added linux-scsi in CC)
> 
> I hope one of the SCSI people can tell us whether the behavior that
> scsi_reset_provider()
> passes the value NULL in req->scmnd->device to
> scsi_try_bus_device_reset() is correct ?

Need more information.

cmd->device is supposed to be initialised in scsi_get_command(), which
scsi_reset_provider() calls ... why do you think it got set to null?

James



      reply	other threads:[~2009-08-05 20:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <e2e108260908030621q102437e0ua60aa5bdfacb2e7e@mail.gmail.com>
     [not found] ` <adafxc8ocst.fsf@cisco.com>
     [not found]   ` <e2e108260908040907l6537c2dcveb64615a664a047e@mail.gmail.com>
     [not found]     ` <adafxc7mtn8.fsf@cisco.com>
     [not found]       ` <e2e108260908041125w730869c0s8d212e2765598c42@mail.gmail.com>
     [not found]         ` <adaljlzl0ne.fsf@cisco.com>
     [not found]           ` <e2e108260908050800p3a6613bbib95fa670248a863@mail.gmail.com>
     [not found]             ` <adaiqh2jgug.fsf@cisco.com>
2009-08-05 17:48               ` [PATCH 2.6.30.4] Fix for NULL pointer dereference by SRP initiator triggered by a SCSI reset after the SRP connection has been closed Bart Van Assche
2009-08-05 17:54               ` Bart Van Assche
2009-08-05 20:37                 ` James Bottomley [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=1249504664.4183.45.camel@mulgrave.site \
    --to=james.bottomley@hansenpartnership.com \
    --cc=bart.vanassche@gmail.com \
    --cc=general@lists.openfabrics.org \
    --cc=hal.rosenstock@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rdreier@cisco.com \
    --cc=sean.hefty@intel.com \
    --cc=vst@vlnb.net \
    /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