Re: [PATCH v3 1/4] ata: libata-scsi: reject reserved bits in 32-byte passthru

From: Damien Le Moal

Date: Thu Nov 12 2026 - 19:37:54 EST


On 11/12/26 23:01, shao.mingyin@xxxxxxxxxx wrote:
> From: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
>
> ATA PASS-THROUGH(32) has no MULTIPLE_COUNT field. Byte 1 is CONTROL,
> and bits 7:5 are reserved or obsolete. Interpreting these bits as a
> multiple count can issue spurious count mismatch warnings for multiple
> commands instead of rejecting the invalid CDB.
>
> Reject nonzero byte 1 bits 7:5 with field pointer 1. Skip the CDB count
> comparison for the 32-byte form while retaining the device multiple-mode
> check. Also point to byte 10 for invalid PROTOCOL. The 12- and 16-byte
> MULTIPLE_COUNT checks remain unchanged.
>
> 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>

One nit below. With that fixed,

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

> + /* Compare with the cached multiple count of libata. */
> + if (multi_count != dev->multi_count)
> + ata_dev_warn(dev, "invalid multi_count %u ignored\n",

Long line. Please split it after "dev,".

> + multi_count);
> + }
> }
>
> /*


--
Damien Le Moal
Western Digital Research