提交 a1537804 编写于 作者: G Gu Zitao 提交者: Zheng Zengkai

sw64: megaraid: fix kernel panic caused by accessing an illegal address

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD
CVE: NA

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

On SUBARCH_C3B, when using the original driver for LSI MegaRAID
SAS-3 PCIe card, a kernel panic may arise from accessing an illegal
address. Make some changes for SUBARCH_C3B to avoid it. But it may
not be avoided entirely.

Signed-off-by: Gu Zitao <guzitao@wxiat.com> #openEuler_contributor
Signed-off-by: NLaibin Qiu <qiulaibin@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 250b1dc9
...@@ -3506,6 +3506,14 @@ complete_cmd_fusion(struct megasas_instance *instance, u32 MSIxIndex, ...@@ -3506,6 +3506,14 @@ complete_cmd_fusion(struct megasas_instance *instance, u32 MSIxIndex,
d_val.u.high != cpu_to_le32(UINT_MAX)) { d_val.u.high != cpu_to_le32(UINT_MAX)) {
smid = le16_to_cpu(reply_desc->SMID); smid = le16_to_cpu(reply_desc->SMID);
#ifdef CONFIG_SUBARCH_C3B
if (smid == 0xffff) {
smid = d_val.u.low >> 16;
if (smid == 0xffff)
break;
}
#endif
cmd_fusion = fusion->cmd_list[smid - 1]; cmd_fusion = fusion->cmd_list[smid - 1];
scsi_io_req = (struct MPI2_RAID_SCSI_IO_REQUEST *) scsi_io_req = (struct MPI2_RAID_SCSI_IO_REQUEST *)
cmd_fusion->io_request; cmd_fusion->io_request;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册