提交 7749d55f 编写于 作者: J Javed Hasan 提交者: Zheng Zengkai

scsi: libfc: Fix array index out of bound exception

stable inclusion
from stable-5.10.53
commit a4a54c54af2516caa9c145015844543cfc84316a
bugzilla: 175574 https://gitee.com/openeuler/kernel/issues/I4DTUX

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a4a54c54af2516caa9c145015844543cfc84316a

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

[ Upstream commit b27c4577 ]

Fix array index out of bound exception in fc_rport_prli_resp().

Link: https://lore.kernel.org/r/20210615165939.24327-1-jhasan@marvell.comSigned-off-by: NJaved Hasan <jhasan@marvell.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 44f6c9d1
...@@ -1162,6 +1162,7 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp, ...@@ -1162,6 +1162,7 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp,
resp_code = (pp->spp.spp_flags & FC_SPP_RESP_MASK); resp_code = (pp->spp.spp_flags & FC_SPP_RESP_MASK);
FC_RPORT_DBG(rdata, "PRLI spp_flags = 0x%x spp_type 0x%x\n", FC_RPORT_DBG(rdata, "PRLI spp_flags = 0x%x spp_type 0x%x\n",
pp->spp.spp_flags, pp->spp.spp_type); pp->spp.spp_flags, pp->spp.spp_type);
rdata->spp_type = pp->spp.spp_type; rdata->spp_type = pp->spp.spp_type;
if (resp_code != FC_SPP_RESP_ACK) { if (resp_code != FC_SPP_RESP_ACK) {
if (resp_code == FC_SPP_RESP_CONF) if (resp_code == FC_SPP_RESP_CONF)
...@@ -1184,11 +1185,13 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp, ...@@ -1184,11 +1185,13 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp,
/* /*
* Call prli provider if we should act as a target * Call prli provider if we should act as a target
*/ */
prov = fc_passive_prov[rdata->spp_type]; if (rdata->spp_type < FC_FC4_PROV_SIZE) {
if (prov) { prov = fc_passive_prov[rdata->spp_type];
memset(&temp_spp, 0, sizeof(temp_spp)); if (prov) {
prov->prli(rdata, pp->prli.prli_spp_len, memset(&temp_spp, 0, sizeof(temp_spp));
&pp->spp, &temp_spp); prov->prli(rdata, pp->prli.prli_spp_len,
&pp->spp, &temp_spp);
}
} }
/* /*
* Check if the image pair could be established * Check if the image pair could be established
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册