diff --git a/0024-fix-segmentation-fault.patch b/0024-fix-segmentation-fault.patch new file mode 100644 index 0000000000000000000000000000000000000000..d23fe4c33bdfd9f543bbd266b140db52113fcde5 --- /dev/null +++ b/0024-fix-segmentation-fault.patch @@ -0,0 +1,27 @@ +From abedc1848cf6305f2c1f20078710755c66415d2d Mon Sep 17 00:00:00 2001 +From: folkert van heusden +Date: Tue, 30 Jan 2024 15:33:20 +0100 +Subject: [PATCH] Fix for https://github.com/sahlberg/libiscsi/issues/409 + 'ms->pages' was not checked for being NULL. This can happen when a target + does not return any pages. + +--- + test-tool/iscsi-support.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test-tool/iscsi-support.c b/test-tool/iscsi-support.c +index 169d2b0..ea9f711 100644 +--- a/test-tool/iscsi-support.c ++++ b/test-tool/iscsi-support.c +@@ -2740,7 +2740,7 @@ int set_swp(struct scsi_device *sdev) + logging(LOG_VERBOSE, "[SUCCESS] CONTROL page fetched."); + + ms = scsi_datain_unmarshall(sense_task); +- if (ms == NULL) { ++ if (ms == NULL || ms->pages == NULL) { + logging(LOG_NORMAL, "failed to unmarshall mode sense datain " + "blob"); + ret = -1; +-- +2.27.0 + diff --git a/libiscsi.spec b/libiscsi.spec index aac16418c2e6090064faecf92aa355e1f0262a74..4bb568cce5da8ee0cb2a9417385fd6770138dd9b 100644 --- a/libiscsi.spec +++ b/libiscsi.spec @@ -29,10 +29,11 @@ Patch20: 0020-Check-return-value-of-scsi_malloc-in-order-to.patch Patch21: 0021-Fix-segmentation-fault-problem.patch Patch22: 0022-init-fix-memory-leak-in-iscsi_create_context.patch Patch23: 0023-iscsi-command-Fix-leak-in-iscsi_send_data_out.patch +Patch24: 0024-fix-segmentation-fault.patch Source: https://github.com/sahlberg/%{name}/archive/%{version}.tar.gz -BuildRequires: gcc +BuildRequires: gcc BuildRequires: autoconf automake libtool popt-devel CUnit-devel libgcrypt-devel rdma-core-devel chrpath %description @@ -130,8 +131,8 @@ This package contains utilities of %{name} to connect to iSCSI targets %{_bindir}/iscsi-test-cu %changelog -* Wed Jul 31 2024 JiangJianJun - 1.19.0-11 -- DESC: fix spec format +* Thu Aug 8 2024 yanshuai - 1.19.0-11 +- DESC: fix segmentation fault * Wed Mar 22 2023 Wenchao Hao - 1.19.0-10 - DESC: backport patch to fix some memory leak issues