[PATCH v3 0/4] ata: libata-scsi: fix ATA PASS-THROUGH(32) handling

From: shao.mingyin

Date: Thu Nov 12 2026 - 10:19:51 EST


ATA PASS-THROUGH(32) still has translation and completion paths that
interpret fields as if the command used a 12- or 16-byte CDB.

Patch 1 rejects nonzero reserved CONTROL bits, skips the nonexistent
MULTIPLE_COUNT comparison and corrects the
invalid-PROTOCOL field pointer. Patch 2 rejects unsupported service
actions with sense data. Patch 3 honors CK_COND and generates SAT sense
on completion. Patch 4 corrects the remaining invalid-field pointers,
including distinguishing READ/WRITE LONG protocol and count errors.
The four patches can be applied independently; the numbered order groups
the related translation fixes together.

Changes in v3 (Damien Le Moal):
- Patch 1: reject nonzero byte 1 bits 7:5 for ATA-32 with field pointer
1; retain the device multiple-mode and 12-/16-byte count checks.
Update its subject, commit message and CONTROL-byte tests.
- Patches 2-4: code unchanged. Patches 2 and 3 keep Damien's
Reviewed-by tag; patch 4 gains the tag from his v2 review.
Link to v2: https://lore.kernel.org/all/20261111223123952mgPDVsbO8uOyaDWL2KELB@xxxxxxxxxx/

Shao Mingyin (4):
ata: libata-scsi: reject reserved bits in 32-byte passthru
ata: libata-scsi: reject unsupported ATA-32 service actions
ata: libata-scsi: generate SAT sense data for ATA PASS-THROUGH(32)
ata: libata-scsi: fix remaining passthru field pointers

drivers/ata/libata-scsi.c | 64 ++++++++++++++++++++++++++++++++++-------------
1 file changed, 46 insertions(+), 18 deletions(-)

---
base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b