提交 6a16d7be 编写于 作者: R Roland Dreier 提交者: Nicholas Bellinger

target: Fix missing length check in spc_emulate_evpd_83()

Commit fbfe858f ("target_core_spc: Include target device
descriptor in VPD page 83") added a new length variable, but (due to a
cut and paste mistake?) just checks scsi_name_len against 256 twice.
Fix this to check scsi_target_len for overflow too.
Signed-off-by: NRoland Dreier <roland@purestorage.com>
Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
上级 2d15025a
......@@ -440,8 +440,8 @@ spc_emulate_evpd_83(struct se_cmd *cmd, unsigned char *buf)
padding = ((-scsi_target_len) & 3);
if (padding)
scsi_target_len += padding;
if (scsi_name_len > 256)
scsi_name_len = 256;
if (scsi_target_len > 256)
scsi_target_len = 256;
buf[off-1] = scsi_target_len;
off += scsi_target_len;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册