All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <mchristi@redhat.com>
To: Yanqing_Liu@Dell.com
Cc: Ahmad_Ali@Dell.com, Shyam_Iyer@Dell.com, dm-devel@redhat.com,
	Charles_Rose@Dell.com, Jacob_Cherian@Dell.com
Subject: Re: Patch to lsi rda  device handler
Date: Thu, 17 Jul 2008 16:46:54 -0500	[thread overview]
Message-ID: <487FBDCE.4080407@redhat.com> (raw)
In-Reply-To: <00FE57DD11E3A94893D5BD54C3358BE884BE1F@AUSX3MPC128.aus.amer.dell.com>

Yanqing_Liu@Dell.com wrote:
> Hello,
> 
> Here is the lsi rdac device handler code that was posted:
> 
> https://www.redhat.com/archives/dm-devel/2008-May/msg00003.html
> 
> The following patch is to address a NULL pointer problem in lsi rdac
> device handler.
> 
> In function get_rdac_req, after a request is successfully allocated, the
> area that the cmd pointer points to should be zeroed out. However, the
> function zeros out the command pointer itself, along with some other
> adjacent area. This results in NULL pointer dereference when submitting
> inquiry commands when checking virtual disk ownership during device
> discovery time. The kernel trace is attached at the end of the message.
> 
> The change is to zero out the area that the cmd pointer points to,
> instead of the pointer itself in the allocated request structure.
> 
> --- scsi_dh_rdac.c.orig	2008-07-17 01:53:10.000000000 -0400
> +++ scsi_dh_rdac.c	2008-07-17 01:45:28.000000000 -0400
> @@ -214,7 +214,7 @@
>  		return NULL;
>  	}
>  
> -	memset(&rq->cmd, 0, BLK_MAX_CDB);
> +	memset(rq->cmd, 0, BLK_MAX_CDB);
>  	rq->sense = h->sense;
>  	memset(rq->sense, 0, SCSI_SENSE_BUFFERSIZE);
>  	rq->sense_len = 0;

Nice catch. Thanks. I guess we need to buy a book on programming in C :) 
Not sure how scsi_dh_hp_sw did it right, but the others goofed and we 
did not catch it.

You should send your writeup and patch to the linux-scsi list, so that 
it can be included in the next batch of patches for 2.6.27. You should 
also fix up scsi_dh_emc.c. Send it all in one big patch.

  reply	other threads:[~2008-07-17 21:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-17 16:56 Patch to lsi rda device handler Yanqing_Liu
2008-07-17 21:46 ` Mike Christie [this message]
2008-07-17 22:30 ` Chandra Seetharaman
2008-07-29 20:43   ` Chandra Seetharaman
2008-07-29 23:04     ` FUJITA Tomonori

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=487FBDCE.4080407@redhat.com \
    --to=mchristi@redhat.com \
    --cc=Ahmad_Ali@Dell.com \
    --cc=Charles_Rose@Dell.com \
    --cc=Jacob_Cherian@Dell.com \
    --cc=Shyam_Iyer@Dell.com \
    --cc=Yanqing_Liu@Dell.com \
    --cc=dm-devel@redhat.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.