1 Star 0 Fork 14

ZJAY998/libiscsi

forked from src-openEuler/libiscsi 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0021-Fix-segmentation-fault-problem.patch 997 Bytes
一键复制 编辑 原始数据 按行查看 历史
geruijun 提交于 2022-06-15 17:04 . fix segmentation fault problem
From 00310fdc2ff77fac84d871a76af67750eacb8594 Mon Sep 17 00:00:00 2001
From: geruijun <geruijun@huawei.com>
Date: Wed, 15 Jun 2022 10:06:40 +0800
Subject: [PATCH] Fix segmentation fault problem.
When execute iscsi_task_mgmt_lun_reset_async function,
pdus are already removed from waitpdu list. In iscsi_service
function, this will call iscsi_process_pdu and release
pdu from waitpdu again, which cause segmentation fault.
Whether waitpud list is NULL should be checked here to avoid
the problem.
Signed-off-by: geruijun <geruijun@huawei.com>
---
lib/pdu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/pdu.c b/lib/pdu.c
index 6fe70db..f9c0bc5 100644
--- a/lib/pdu.c
+++ b/lib/pdu.c
@@ -622,7 +622,7 @@ iscsi_process_pdu(struct iscsi_context *iscsi, struct iscsi_in_pdu *in)
return -1;
}
- if (is_finished) {
+ if (is_finished && iscsi->waitpdu != NULL) {
ISCSI_LIST_REMOVE(&iscsi->waitpdu, pdu);
iscsi->drv->free_pdu(iscsi, pdu);
}
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zjay998/libiscsi.git
git@gitee.com:zjay998/libiscsi.git
zjay998
libiscsi
libiscsi
master

搜索帮助