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
F102054676: D46611.diff
Thu, Nov 7, 1:27 AM
Unknown Object (File)
Tue, Nov 5, 6:38 AM
Unknown Object (File)
Thu, Oct 24, 7:41 PM
Unknown Object (File)
Mon, Oct 21, 8:24 PM
Unknown Object (File)
Wed, Oct 16, 8:51 PM
Unknown Object (File)
Mon, Oct 14, 7:56 PM
Unknown Object (File)
Mon, Oct 14, 7:55 PM
Unknown Object (File)
Mon, Oct 14, 12:22 PM
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 59583
Build 56470: 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
7478

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.

7469–7477

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