Files
libiscsi/lib
David Disseldorp c88e9715ab lib/scsi: fix SCSI_PERSISTENT_RESERVE_READ_KEYS handling
When unmarshalling a SCSI_PERSISTENT_RESERVE_READ_KEYS response,
scsi_persistentreservein_datain_unmarshall() assumes that the ADDITIONAL
LENGTH field represents the number of keys packed in the key array.
This is incorrect as key array data buffer may be truncated while
ADDITIONAL LENGTH is left in tact, as per SPC5r17 4.2.5.6:

  If the information being transferred to the Data-In Buffer includes
  fields containing counts ..., then the contents of these fields shall
  not be altered to reflect the truncation, if any, that results from an
  insufficient ALLOCATION LENGTH value, unless the standard that
  describes the Data-In Buffer format states otherwise.

Determine the number of keys returned based on the minimum of the
data-in length and the ADDITIONAL LENGTH value.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2018-05-31 23:10:28 +02:00
..
2017-11-25 17:03:01 +00:00
2017-11-29 10:07:44 -05:00
2017-11-25 17:03:01 +00:00
2018-04-30 18:11:05 -04:00
2017-11-29 10:07:44 -05:00
2017-11-29 10:07:44 -05:00
2017-11-29 10:07:44 -05:00
2017-11-25 17:03:01 +00:00
2017-11-29 10:07:44 -05:00
2017-11-25 17:12:38 +00:00