Page MenuHomeFreeBSD

ctl_report_supported_opcodes: Handle invalid requested service action
ClosedPublic

Authored by jhb on Sep 9 2024, 6:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 6:11 PM
Unknown Object (File)
Sun, Nov 24, 2:23 AM
Unknown Object (File)
Fri, Nov 22, 6:28 PM
Unknown Object (File)
Fri, Nov 22, 10:29 AM
Unknown Object (File)
Tue, Nov 19, 9:05 PM
Unknown Object (File)
Sun, Nov 17, 10:34 PM
Unknown Object (File)
Sun, Nov 17, 9:43 PM
Unknown Object (File)
Sat, Nov 16, 11:44 AM
Subscribers

Details

Summary

Service actions are only valid up to 31 as they are encoded in the low
5 bits of byte 1 in CDBs. Fail requests with a requested service
action of 32 or higher with an INVALID FIELD IN COMMAND specifying
byte 4 as the illegal byte.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 59408
Build 56295: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Sep 9 2024, 6:14 PM
jhb added inline comments.
sys/cam/ctl/ctl.c
7485

Note that this is not a generic "there's an invalid field in the command", but is specifically saying that the RSO_OPTIONS field in the cdb->options byte is invalid.

sys/cam/ctl/ctl.c
7439

Should "field" be 4 for REQUESTED SERVICE ACTION instead of 1 for SERVICE ACTION?

khorben_defora.org added a parent revision: Restricted Differential Revision.Sep 10 2024, 10:56 PM
sys/cam/ctl/ctl.c
7439

Sigh, yes, and actually, it needs to be ignored for RSO_OPTIONS_ALL and RSO_OPTIONS_OC so I need to revisit this a bit.

jhb retitled this revision from ctl: Correctly reject invalid service action for REPORT SUPPORTED OPCODES to ctl_report_supported_opcodes: Handle invalid requested service action.Sep 24 2024, 4:32 PM
jhb edited the summary of this revision. (Show Details)
jhb edited the summary of this revision. (Show Details)

Split up and only check RSA when relevant

jhb marked an inline comment as done.Sep 24 2024, 4:35 PM
jhb added inline comments.
sys/cam/ctl/ctl.c
7439

This should now be fixed.

7494–7495

Removing the SA5 check here is on purpose, for the ASA case both with and without SA5 is fine and is handled below.

This revision is now accepted and ready to land.Oct 3 2024, 9:51 PM