Page MenuHomeFreeBSD

D46611.diff
No OneTemporary

D46611.diff

diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -7432,6 +7432,17 @@
opcode = cdb->requested_opcode;
service_action = scsi_2btoul(cdb->requested_service_action);
+ if (service_action >= 32) {
+ ctl_set_invalid_field(/*ctsio*/ ctsio,
+ /*sks_valid*/ 1,
+ /*command*/ 1,
+ /*field*/ 1,
+ /*bit_valid*/ 0,
+ /*bit*/ 0);
+ ctl_done((union ctl_io *)ctsio);
+ return (CTL_RETVAL_COMPLETE);
+ }
+
switch (cdb->options & RSO_OPTIONS_MASK) {
case RSO_OPTIONS_ALL:
num = 0;
@@ -7468,21 +7479,22 @@
total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32;
break;
case RSO_OPTIONS_OC_SA:
- if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) == 0 ||
- service_action >= 32) {
- goto invalid;
+ if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) == 0) {
+ ctl_set_invalid_field(/*ctsio*/ ctsio,
+ /*sks_valid*/ 1,
+ /*command*/ 1,
+ /*field*/ 2,
+ /*bit_valid*/ 1,
+ /*bit*/ 2);
+ ctl_done((union ctl_io *)ctsio);
+ return (CTL_RETVAL_COMPLETE);
}
total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32;
break;
case RSO_OPTIONS_OC_ASA:
- if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) != 0 &&
- service_action >= 32) {
- goto invalid;
- }
total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32;
break;
default:
-invalid:
ctl_set_invalid_field(/*ctsio*/ ctsio,
/*sks_valid*/ 1,
/*command*/ 1,

File Metadata

Mime Type
text/plain
Expires
Sun, Sep 22, 9:51 AM (19 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
11596359
Default Alt Text
D46611.diff (1 KB)

Event Timeline