lkml.org 
[lkml]   [2007]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch 22/33] 3w-xxxx: fix oops caused by incorrect REQUEST_SENSE handling

    -stable review patch. If anyone has any objections, please let us know.

    ------------------
    From: James Bottomley <James.Bottomley@steeleye.com>

    3w-xxxx emulates a REQUEST_SENSE response by simply returning nothing.
    Unfortunately, it's assuming that the REQUEST_SENSE command is
    implemented with use_sg == 0, which is no longer the case. The oops
    occurs because it's clearing the scatterlist in request_buffer instead
    of the memory region.

    This is fixed by using tw_transfer_internal() to transfer correctly to
    the scatterlist.

    Acked-by: adam radford <aradford@gmail.com>
    Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    drivers/scsi/3w-xxxx.c | 11 +++++++++--
    1 file changed, 9 insertions(+), 2 deletions(-)

    --- a/drivers/scsi/3w-xxxx.c
    +++ b/drivers/scsi/3w-xxxx.c
    @@ -1864,10 +1864,17 @@ static int tw_scsiop_read_write(TW_Devic
    /* This function will handle the request sense scsi command */
    static int tw_scsiop_request_sense(TW_Device_Extension *tw_dev, int request_id)
    {
    + char request_buffer[18];
    +
    dprintk(KERN_NOTICE "3w-xxxx: tw_scsiop_request_sense()\n");

    - /* For now we just zero the request buffer */
    - memset(tw_dev->srb[request_id]->request_buffer, 0, tw_dev->srb[request_id]->request_bufflen);
    + memset(request_buffer, 0, sizeof(request_buffer));
    + request_buffer[0] = 0x70; /* Immediate fixed format */
    + request_buffer[7] = 10; /* minimum size per SPC: 18 bytes */
    + /* leave all other fields zero, giving effectively NO_SENSE return */
    + tw_transfer_internal(tw_dev, request_id, request_buffer,
    + sizeof(request_buffer));
    +
    tw_dev->state[request_id] = TW_S_COMPLETED;
    tw_state_request_finish(tw_dev, request_id);

    --
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-04-26 19:11    [W:4.151 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site