Merge branch 'master' of gitee.com:src-openeuler/open-iscsi into master

This commit is contained in:
sigui 2020-06-16 09:21:22 +08:00 committed by Gitee
commit 59e109870a
3 changed files with 75 additions and 2 deletions

View File

@ -0,0 +1,35 @@
From 05766f1e85ea7fbf975559d27814c769328c72dd Mon Sep 17 00:00:00 2001
From: liubo <liubo254@huawei.com>
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 <liubo254@huawei.com>
Reported-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
---
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)

View File

@ -0,0 +1,33 @@
From e5c4073ae836cd049a4bc3d6c1291a25f88ad67d Mon Sep 17 00:00:00 2001
From: lixiaokeng <lixiaokeng@huawei.com>
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 <lixiaokeng@huawei.com>
Reported-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
---
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)

View File

@ -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 Patch0040: 0040-iscsi-iname-remove-unneeded-temp-buffer.patch
Patch0041: 0041-Fix-issue-where-iscsi-iname-p-core-dumps.patch Patch0041: 0041-Fix-issue-where-iscsi-iname-p-core-dumps.patch
Patch0042: 0042-modify-iSCSI-shared-memory-permissions-for-logs.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: flex bison doxygen kmod-devel systemd-units gcc git isns-utils-devel
BuildRequires: autoconf automake libtool libmount-devel openssl-devel pkg-config gdb BuildRequires: autoconf automake libtool libmount-devel openssl-devel pkg-config gdb
@ -187,9 +189,12 @@ fi
%{_mandir}/man8/* %{_mandir}/man8/*
%changelog %changelog
* Mon Jun 15 2020 sunguoshuai <sunguoshuai@huawei.com> - 2.0.876-20 * Mon Jun 15 2020 sunguoshuai <sunguoshuai@huawei.com> - 2.0.876-21
- fix devel without node header files - fix devel without node header files
* Mon Jun 15 2020 Zhiqiang Liu <liuzhiqiang26@huawei.com> - 2.0.876-20
- Backport two upstream bugfix patches
* Tue May 12 2020 Wu Bo <wubo@huawei.com> - 2.0.876-19 * Tue May 12 2020 Wu Bo <wubo@huawei.com> - 2.0.876-19
- iscsi-iname verfiy prefix length is at most 210 characters. - iscsi-iname verfiy prefix length is at most 210 characters.
iscsi-iname remove unneeded temp buffer. iscsi-iname remove unneeded temp buffer.