Re: [PATCH v3 1/4] ata: libata-scsi: reject reserved bits in 32-byte passthru
From: shao.mingyin
Date: Fri Nov 13 2026 - 13:41:32 EST
On Fri, Nov 13, 2026 at 04:36:46PM +0100, Niklas Cassel wrote:
> READ/WRITE MULTIPLE commands are still accepted with the 32-byte CDB, it is
> only the count comparison that will be skipped.
Agreed, the v3 comment was misleading. The v4 comment only describes the
pio multi command check. READ/WRITE MULTIPLE is still accepted with the
32-byte CDB; only the short-CDB count comparison is skipped. The
dev->multi_count check, including ABORTED COMMAND for a zero count, is
kept for all CDB lengths.
> The reserved bits in place of MULTIPLE_COUNT are bits 7:5 of byte 10.
You are right, v3 checked the wrong byte. v4 rejects nonzero byte 10
bits 7:5 with fp=10, and does not look at byte 1 for ATA-32 at all, so
CONTROL values with the vendor-specific bits 7:6 set are accepted. The
commit message no longer calls them reserved or obsolete.
The function harness crosses all 256 CONTROL values and all eight
byte-10 high-bit patterns for a non-multiple command and all five
READ/WRITE MULTIPLE opcodes. It confirms rejection with fp=10, that
CONTROL no longer affects count validation, and that the 12-/16-byte
checks are unchanged. These are userspace tests with device and sense
stubs, not SG_IO or hardware tests. The libata-scsi object builds with
W=1.
I am sending the four-patch v4 separately. Patch 1 no longer carries the
v3 Reviewed-by tag because its behavior changed; patches 2-4 keep
Damien's.
Thanks,
Mingyin