diff options
| author | Niklas Cassel <cassel@kernel.org> | 2026-11-03 21:54:54 +0100 |
|---|---|---|
| committer | Niklas Cassel <cassel@kernel.org> | 2026-11-07 13:34:39 +0100 |
| commit | a3e52dcf0fbaa1a103accef3e8861cdc250ee5d6 (patch) | |
| tree | eadeddac5201ec51eba0c317600e116409021e50 /scripts/dummy-tools/python3 | |
| parent | 2a4c61cf94d48ec8560473d4fd5383583ce8809c (diff) | |
ata: libata-scsi: fix MODE SELECT field pointer for block descriptor length
ata_scsi_mode_select_xlat() only accepts MODE SELECT parameter lists
without block descriptors or with a single 8 byte block descriptor. For
any other BLOCK DESCRIPTOR LENGTH, it terminates the command with
INVALID FIELD IN PARAMETER LIST, and the FIELD POINTER should point at
the BLOCK DESCRIPTOR LENGTH field, i.e. at byte 3 of the mode parameter
header(6) or at byte 6 of the mode parameter header(10), as SPC requires
the FIELD POINTER of a multiple-byte field to point at its first byte.
However, the mode parameter header length and the BLOCK DESCRIPTOR
LENGTH are added to the offset of the field, so the FIELD POINTER points
3 or 6 bytes after the end of the block descriptors instead. For
example, a MODE SELECT(10) with a BLOCK DESCRIPTOR LENGTH of 16 reports
byte 30 instead of byte 6.
Do not add the mode parameter header length and the BLOCK DESCRIPTOR
LENGTH to the offset of the BLOCK DESCRIPTOR LENGTH field.
Fixes: 7780081c1f04 ("libata-scsi: Set information sense field for invalid parameter")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20261103205448.931471-15-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Diffstat (limited to 'scripts/dummy-tools/python3')
0 files changed, 0 insertions, 0 deletions
