[ipxe-devel] [PATCH 1/3] scsi: Improve sense code parsing

Hannes Reinecke hare at suse.de
Tue Jun 3 10:20:52 UTC 2014


On 06/03/2014 12:12 PM, Michael Brown wrote:
> On 03/06/14 08:18, Hannes Reinecke wrote:
>> Sadly, it's not equivalent.
>> My patch parsed the asc and ascq values, too.
>
> So does this one: they are present as:
>
>      /** Additional sense code and qualifier */
>      uint16_t additional;
>
> and displayed in
>
>      DBGC ( scsidev, " sense %02x key %02x additional %04x\n",
>             ( response->sense.code & SCSI_SENSE_CODE_MASK ),
>             ( response->sense.key & SCSI_SENSE_KEY_MASK ),
>             ntohs ( response->sense.additional ) );
>
> For example, with a non-existent LUN I get the message:
>
>    SCSI 0xXXXXX tag YYYYYYYY status 02 sense 70 key 00 additional 2500
>
> and table D.1 in SPC-4 shows this as meaning:
>
>    25h 00h   DTLPWROMAEBKVF   LOGICAL UNIT NOT SUPPORTED
>
>> What was wrong with my original patch?
>
> It potentially read beyond the end of the packet, in the case of a
> malformed packet.  (This was a flaw in the original code as well,
> but a patch in that area should probably fix the problem rather than
> make it worse by potentially reading even further.)
>
Hmm. Okay. Not what I would've done, but there you go.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare at suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)



More information about the ipxe-devel mailing list