We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f9f300a commit b847ecfCopy full SHA for b847ecf
drivers/scsi/scsi_debug.c
@@ -2296,11 +2296,11 @@ static int resp_mode_select(struct scsi_cmnd *scp,
2296
__func__, param_len, res);
2297
md_len = mselect6 ? (arr[0] + 1) : (get_unaligned_be16(arr + 0) + 2);
2298
bd_len = mselect6 ? arr[3] : get_unaligned_be16(arr + 6);
2299
- if (md_len > 2) {
+ off = bd_len + (mselect6 ? 4 : 8);
2300
+ if (md_len > 2 || off >= res) {
2301
mk_sense_invalid_fld(scp, SDEB_IN_DATA, 0, -1);
2302
return check_condition_result;
2303
}
- off = bd_len + (mselect6 ? 4 : 8);
2304
mpage = arr[off] & 0x3f;
2305
ps = !!(arr[off] & 0x80);
2306
if (ps) {
0 commit comments