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)
Mon, Dec 2, 12:35 PM
Unknown Object (File)
Sun, Dec 1, 9:32 AM
Unknown Object (File)
Sun, Dec 1, 7:11 AM
Unknown Object (File)
Fri, Nov 29, 11:12 AM
Unknown Object (File)
Thu, Nov 28, 3:54 PM
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
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 Not Applicable
Unit
Tests Not Applicable

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