Re: [PATCH v2 4/4] ata: libata-scsi: fix remaining passthru field pointers

From: Damien Le Moal

Date: Wed Nov 11 2026 - 18:42:18 EST


On 11/11/26 23:31, shao.mingyin@xxxxxxxxxx wrote:
> From: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
>
> Several error paths in ata_scsi_pass_thru() report field pointers for
> the 12- or 16-byte CDB when rejecting a 32-byte CDB. Initiators then
> receive INVALID FIELD IN CDB sense data pointing at an unrelated byte.
> READ/WRITE LONG also reports PROTOCOL when its sector count is invalid.
>
> Use the PROTOCOL offset and record the FEATURES, SECTOR COUNT and
> COMMAND offsets for each CDB format. Report SECTOR COUNT separately
> from PROTOCOL when validating READ/WRITE LONG.
>
> Fixes: b1ffbf854e08 ("libata: Support for an ATA PASS-THROUGH(32) command.")
> Suggested-by: Niklas Cassel <cassel@xxxxxxxxxx>
> Signed-off-by: Shao Mingyin <shao.mingyin@xxxxxxxxxx>

Looks good.

Reviewed-by: Damien Le Moal <dlemoal@xxxxxxxxxx>

--
Damien Le Moal
Western Digital Research