diff --git a/0043-iscsi-Add-break-to-while-loop.patch b/0043-iscsi-Add-break-to-while-loop.patch new file mode 100644 index 0000000..98a48ac --- /dev/null +++ b/0043-iscsi-Add-break-to-while-loop.patch @@ -0,0 +1,35 @@ +From 05766f1e85ea7fbf975559d27814c769328c72dd Mon Sep 17 00:00:00 2001 +From: liubo +Date: Thu, 4 Jun 2020 16:57:07 +0800 +Subject: [PATCH] iscsi: Add break to while loop + +Fix the potential risk of rc value being washed out by jumping out of the loop + +Source Link: https://github.com/open-iscsi/open-iscsi/pull/211 + +Signed-off-by: liubo +Reported-by: Zhiqiang Liu +--- + utils/fwparam_ibft/fwparam_sysfs.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/utils/fwparam_ibft/fwparam_sysfs.c b/utils/fwparam_ibft/fwparam_sysfs.c +index a0cd1c7..87fd6d4 100644 +--- a/utils/fwparam_ibft/fwparam_sysfs.c ++++ b/utils/fwparam_ibft/fwparam_sysfs.c +@@ -115,8 +115,11 @@ static int get_iface_from_device(char *id, struct boot_context *context) + break; + } + +- if (sscanf(dent->d_name, "net:%s", context->iface) != 1) ++ if (sscanf(dent->d_name, "net:%s", context->iface) != 1) { + rc = EINVAL; ++ break; ++ } ++ + rc = 0; + break; + } else { +-- +2.21.1 (Apple Git-122.3) + diff --git a/0044-iscsi-fix-fd-leak.patch b/0044-iscsi-fix-fd-leak.patch new file mode 100644 index 0000000..9befe8b --- /dev/null +++ b/0044-iscsi-fix-fd-leak.patch @@ -0,0 +1,33 @@ +From e5c4073ae836cd049a4bc3d6c1291a25f88ad67d Mon Sep 17 00:00:00 2001 +From: lixiaokeng +Date: Thu, 4 Jun 2020 20:35:18 +0800 +Subject: [PATCH] iscsi: fix fd leak + +iscsi-review/utils/fwparam_ibft/fwparam_ibft.c: line 466 + +Before return -1, the fd was opend and not closed which would lead +to leak fd. Fix that. + +Source Link: https://github.com/open-iscsi/open-iscsi/pull/212 + +Signed-off-by: lixiaokeng +Reported-by: Zhiqiang Liu +--- + utils/fwparam_ibft/fwparam_ibft.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/utils/fwparam_ibft/fwparam_ibft.c b/utils/fwparam_ibft/fwparam_ibft.c +index 52edac1..e68e503 100644 +--- a/utils/fwparam_ibft/fwparam_ibft.c ++++ b/utils/fwparam_ibft/fwparam_ibft.c +@@ -463,6 +463,7 @@ fwparam_ibft(struct boot_context *context, const char *filepath) + if (stat(filename, &buf)!=0) { + fprintf(stderr, "Could not stat file %s: %s (%d)\n", + filename, strerror(errno), errno); ++ close(fd); + return -1; + } + /* And if not zero use that size */ +-- +2.21.1 (Apple Git-122.3) + diff --git a/open-iscsi.spec b/open-iscsi.spec index ffbc60f..fd6579f 100644 --- a/open-iscsi.spec +++ b/open-iscsi.spec @@ -54,7 +54,9 @@ Patch0039: 0039-iscsi-iname-verify-prefix-length-is-at-most-210.patch Patch0040: 0040-iscsi-iname-remove-unneeded-temp-buffer.patch Patch0041: 0041-Fix-issue-where-iscsi-iname-p-core-dumps.patch Patch0042: 0042-modify-iSCSI-shared-memory-permissions-for-logs.patch -Patch0043: 0043-Fix-devel-without-node-header-files.patch +Patch0043: 0043-iscsi-Add-break-to-while-loop.patch +Patch0044: 0044-iscsi-fix-fd-leak.patch +Patch0045: 0045-Fix-devel-without-node-header-files.patch BuildRequires: flex bison doxygen kmod-devel systemd-units gcc git isns-utils-devel BuildRequires: autoconf automake libtool libmount-devel openssl-devel pkg-config gdb @@ -187,9 +189,12 @@ fi %{_mandir}/man8/* %changelog -* Mon Jun 15 2020 sunguoshuai - 2.0.876-20 +* Mon Jun 15 2020 sunguoshuai - 2.0.876-21 - fix devel without node header files +* Mon Jun 15 2020 Zhiqiang Liu - 2.0.876-20 +- Backport two upstream bugfix patches + * Tue May 12 2020 Wu Bo - 2.0.876-19 - iscsi-iname verfiy prefix length is at most 210 characters. iscsi-iname remove unneeded temp buffer.