[PATCH v4 0/4] ata: libata-scsi: fix ATA PASS-THROUGH(32) handling
From: shao.mingyin
Date: Fri Nov 13 2026 - 13:20:11 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 checks the reserved bits in byte 10, skips the nonexistent
MULTIPLE_COUNT field, 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 field pointers, including READ/WRITE LONG count errors.
The four patches can be applied independently.
Changes in v4:
- Patch 1: follow Niklas's correction to validate byte 10 bits 7:5
with fp=10, leave CONTROL out of the count checks, and retain
READ/WRITE MULTIPLE support. Correct the comment and description.
Split the warning after dev, per Damien's nit. Extend the function
tests to cross CONTROL values and byte-10 reserved bits.
- Patches 2-4: code and commit messages unchanged; retain Damien's
Reviewed-by tags. Patch 1 needs review again after its behavior change.
Previous version: https://lore.kernel.org/all/20261112220113627e1oAXj5lbAzyI0Xe6Joud@xxxxxxxxxx/
Codex assisted with the review changes, descriptions and validation
scripts. The updated code was function-tested and build-tested.
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 | 70 +++++++++++++++++++++++++++++++++--------------
1 file changed, 50 insertions(+), 20 deletions(-)
---
base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b