diff options
| author | Niklas Cassel <cassel@kernel.org> | 2026-11-03 21:54:52 +0100 |
|---|---|---|
| committer | Niklas Cassel <cassel@kernel.org> | 2026-11-07 13:34:39 +0100 |
| commit | a1eb72c477ec1320c540f27ce1e2f717d4518e62 (patch) | |
| tree | de4b7b90c2e8fae3d9f39a2856a8c92c7d418198 /scripts/dummy-tools/python3 | |
| parent | b29c40dc150b0b4218c4d6844770892eb6b2f6b5 (diff) | |
ata: libata-scsi: reject MODE SELECT mode pages with a wrong SPF bit
ata_scsi_mode_select_xlat() accepts the caching and control mode pages
both in page_0 format and in sub_page format with SUBPAGE CODE 00h.
However, SAT-2 and later versions of SAT define the SPF bit of the
Caching mode page and of the Control mode page as not changeable and
set to zero (see SAT-6, 10.4.9 and 10.4.6), and SPC-7 (6.12, MODE
SELECT(10) command) requires the device server to terminate a MODE
SELECT command with INVALID FIELD IN PARAMETER LIST if the application
client sets any field that is reported as not changeable to a value
other than its current value.
Reject a mode page with the SPF bit set to one and SUBPAGE CODE 00h,
with the FIELD POINTER set to the byte containing the SPF bit. The only
mode page with the SPF bit set to one that remains accepted is the ATA
Feature Control mode page (control mode page, sub-page f2h), for which
SAT-6 (12.3.4) requires the SPF bit to be set to one. The opposite case
does not need a check: a mode page in page_0 format always has subpage
code 00h, so it can never be the ATA Feature Control mode page.
This also allows the mode page handlers to rely on the format of their
mode page, which a later patch will make use of.
Fixes: 1b26d29ccd59 ("[libata] scsi: implement MODE SELECT command")
Link: https://lore.kernel.org/r/20261103205448.931471-13-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Diffstat (limited to 'scripts/dummy-tools/python3')
0 files changed, 0 insertions, 0 deletions
