提交 75724595 编写于 作者: Z zhengbin 提交者: Xie XiuQi

sr: need to check whether sshdr is valid in sr_do_ioctl

hulk inclusion
category: bugfix
bugzilla: 23457
CVE: NA

---------------------------

Like other callers of scsi_execute(send_trespass_cmd, hp_sw_tur...),
we need to check whether sshdr is valid.
Signed-off-by: Nzhengbin <zhengbin13@huawei.com>
Reviewed-by: NJason Yan <yanaijie@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 33f8827e
...@@ -206,6 +206,11 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) ...@@ -206,6 +206,11 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc)
/* Minimal error checking. Ignore cases we know about, and report the rest. */ /* Minimal error checking. Ignore cases we know about, and report the rest. */
if (driver_byte(result) != 0) { if (driver_byte(result) != 0) {
if (!scsi_sense_valid(sshdr)) {
err = -EIO;
goto out;
}
switch (sshdr->sense_key) { switch (sshdr->sense_key) {
case UNIT_ATTENTION: case UNIT_ATTENTION:
SDev->changed = 1; SDev->changed = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册