Re: [Bugme-new] [Bug 5003] New: Problem with symbios driver on recent -mm trees

From: Martin J. Bligh
Date: Tue Aug 09 2005 - 18:24:06 EST


--On Tuesday, August 09, 2005 11:55:36 -0500 James Bottomley <James.Bottomley@xxxxxxxxxxxx> wrote:

> On Tue, 2005-08-09 at 07:59 -0700, Martin J. Bligh wrote:
>> Dear novice test examiner,
>>
>> It's in http://test.kernel.org with everything else ;-)
>> 2.6.13-rc4-mm1+jejb_fix ... drills down to:
>>
>> http://test.kernel.org/10080/debug/console.log
>
> Well, OK, apparently some novice coder made an error converting from a
> stack allocated buffer to a kmalloc'd one in the sense handling
> routines.
>
> I think this patch should fix it (or at least restore it to the level of
> bugginess it had before).


Wheeeeeee! that fixed it. Thanks very much. Log is here if you want to
peek at it:


http://test.kernel.org/10431/debug/console.log

Triples all round!

M.

> James
>
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -342,12 +342,12 @@ int scsi_execute_req(struct scsi_device
> sense = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
> if (!sense)
> return DRIVER_ERROR << 24;
> - memset(sense, 0, sizeof(*sense));
> + memset(sense, 0, SCSI_SENSE_BUFFERSIZE);
> }
> result = scsi_execute(sdev, cmd, data_direction, buffer, bufflen,
> sense, timeout, retries, 0);
> if (sshdr)
> - scsi_normalize_sense(sense, sizeof(*sense), sshdr);
> + scsi_normalize_sense(sense, SCSI_SENSE_BUFFERSIZE, sshdr);
>
> kfree(sense);
> return result;
>
>
>
>


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