public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@SteelEye.com>
To: David Miller <davem@davemloft.net>
Cc: aab@cichlid.com, linux-kernel@vger.kernel.org,
	linux-scsi@vger.kernel.org
Subject: Re: Oops in scsi_send_eh_cmnd 2.6.21-rc5-git6,7,10,13
Date: Thu, 05 Apr 2007 19:51:00 -0500	[thread overview]
Message-ID: <1175820660.3714.48.camel@mulgrave.il.steeleye.com> (raw)
In-Reply-To: <20070405.171506.125894469.davem@davemloft.net>

On Thu, 2007-04-05 at 17:15 -0700, David Miller wrote:
> This won't work I believe.
> 
> There are cases that use smaller sense buffers than the minimum
> specified by the SCSI layer.
> 
> One example is that do_sr_ioctl() stuff when the cgc passed
> in has a sense buffer.  That will only be as large as a
> "struct request_sense".
> 
> I'm pretty sure that's one of the reasons why we cons up a local sense
> buffer in this EH code.
> 
> So we could walk past the end of that and corrupt memory with
> your patch.

That should be fine ... the application copies the sense out of
scmnd->sense_buffer ... it can take as much or as little as it wants
(sense_buffer is actually a SCSI_SENSE_BUFFERSIZE array inside the
command). There was one thing I missed, which is that the sense buffer
size of the command is 252, whereas I need to set it back down to
sizeof(scmnd->sense_buffer).

This is another area where we "could do better" ... the request actually
gives us a sense buffer, but we use our own and later copy data out of
it back into the request.

James



  reply	other threads:[~2007-04-06  0:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-05 22:13 Oops in scsi_send_eh_cmnd 2.6.21-rc5-git6,7,10,13 Andrew Burgess
2007-04-05 22:36 ` David Miller
2007-04-06  0:02   ` James Bottomley
2007-04-06  0:15     ` David Miller
2007-04-06  0:51       ` James Bottomley [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-04-06  2:21 Andrew Burgess
2007-04-06 13:44 ` James Bottomley
2007-04-06 15:12 Andrew Burgess
2007-04-06 15:27 ` James Bottomley
2007-04-06 18:32   ` David Miller
2007-04-06 21:35     ` James Bottomley
2007-04-06 15:51 Andrew Burgess
2007-04-06 16:14 ` James Bottomley
2007-04-06 16:32   ` Douglas Gilbert
2007-04-06 16:47     ` James Bottomley
2007-04-06 18:18 Andrew Burgess

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=1175820660.3714.48.camel@mulgrave.il.steeleye.com \
    --to=james.bottomley@steeleye.com \
    --cc=aab@cichlid.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@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