Re: [PATCH] [SCSI] gdth: Allocate sense_buffer to prevent NULL pointerdereference

From: Boaz Harrosh
Date: Tue Mar 11 2008 - 11:48:19 EST


On Mon, Mar 10 2008 at 23:50 +0200, Sven Schnelle <svens@xxxxxxxxxxxx> wrote:
> James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx> writes:
>
>> On Mon, 2008-03-10 at 17:20 +0200, Boaz Harrosh wrote:
>>> James and linux-scsi CCed.
>> Looks fine .. could someone send the patch in an applyable form (i.e.
>> not quoted).
>
> Sure:
>
> Fix NULL pointer dereference during execution of Internal commands,
> where gdth only allocates scp, but not scp->sense_buffer. The rest of
> the code assumes that sense_buffer is allocated, which leads to a kernel
> oops e.g. on reboot (during cache flush).
>
> Signed-off-by: Sven Schnelle <svens@xxxxxxxxxxxxxx>
> ---
<snip>

Hi Sven.

Do you have gdth HW for testing patches?
I'm anticipating more scsi-ml changes in that regard in near future and would like
a more permanent solution for gdth. Could you please try below patch in place of
your patch and see if it works.

Thanks in advance

James Hi
do you think we should keep Sven's patch for the rc-fixes and my solution
for the next kernel? For the reason that my patch might be theoretically dangerous
in regard to locking, queue-life-time, and such side effects?

Boaz
---