aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-Do-not-double-close-IPC-file-stream-to-iscsid.patch
diff options
context:
space:
mode:
authorZhixiong Chi <zhixiong.chi@windriver.com>2018-01-04 02:52:14 -0800
committerArmin Kuster <akuster808@gmail.com>2018-10-15 12:50:46 -0700
commit59c43205f13c0e61b44eb42ffbf2af6cbfd3e6c0 (patch)
treef31fe9352b14cf0fea61f6e594e18e1885996739 /meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-Do-not-double-close-IPC-file-stream-to-iscsid.patch
parent1b5bafb1127c96f5d6c071c413d4339f625a9573 (diff)
downloadmeta-openembedded-contrib-59c43205f13c0e61b44eb42ffbf2af6cbfd3e6c0.tar.gz
iscsi-initiator-utils: CVE-2017-17840stable/rocko-nmut
Backport CVE patches from the github upstream: https://github.com/open-iscsi/open-iscsi commit as follows: e313bd648a4c8a9526421e270eb597a5de1e0c7f b9c33683bdc0aed28ffe31c3f3d50bf5cdf519ea be58eed849f5457bb49b79e94aa6a26971ba6deb 5504053cc08df38d8d85032fa1691e363dfcfb92 85f647c4300a888bb6cbc27f33138549cab617e3 a7a96131bd2ea342f6def0e46be514baf8037ae8 59ede2cf4eee8729a4221000a5d1ecdd312a31ac https://nvd.nist.gov/vuln/detail/CVE-2017-17840 A local attacker can cause the iscsiuio server to abort or potentially execute code by sending messages with incorrect lengths, which (due to lack of checking) can lead to buffer overflows, and result in aborts (with overflow checking enabled) or code execution. The process_iscsid_broadcast function in iscsiuio/src/unix/iscsid_ipc.c does not validate the payload length before a write operation Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com> (cherry picked from commit fdd3c62df9f4cb4e263aca4ab426ae9f88b29912) Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-Do-not-double-close-IPC-file-stream-to-iscsid.patch')
-rw-r--r--meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-Do-not-double-close-IPC-file-stream-to-iscsid.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-Do-not-double-close-IPC-file-stream-to-iscsid.patch b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-Do-not-double-close-IPC-file-stream-to-iscsid.patch
new file mode 100644
index 0000000000..274722c231
--- /dev/null
+++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-Do-not-double-close-IPC-file-stream-to-iscsid.patch
@@ -0,0 +1,62 @@
+From 8167e5ce99682f64918a20966ce393cd33ac67ef Mon Sep 17 00:00:00 2001
+From: Lee Duncan <lduncan@suse.com>
+Date: Fri, 15 Dec 2017 11:13:29 -0800
+Subject: [PATCH 4/7] Do not double-close IPC file stream to iscsid
+
+A double-close of a file descriptor and its associated FILE stream
+can be an issue in multi-threaded cases. Found by Qualsys.
+
+CVE: CVE-2017-17840
+
+Upstream-Status: Backport
+
+Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
+---
+ iscsiuio/src/unix/iscsid_ipc.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/iscsiuio/src/unix/iscsid_ipc.c b/iscsiuio/src/unix/iscsid_ipc.c
+index 61e96cc..bde8d66 100644
+--- a/iscsiuio/src/unix/iscsid_ipc.c
++++ b/iscsiuio/src/unix/iscsid_ipc.c
+@@ -913,6 +913,9 @@ early_exit:
+ /**
+ * process_iscsid_broadcast() - This function is used to process the
+ * broadcast messages from iscsid
++ *
++ * s2 is an open file descriptor, which
++ * must not be left open upon return
+ */
+ int process_iscsid_broadcast(int s2)
+ {
+@@ -928,6 +931,7 @@ int process_iscsid_broadcast(int s2)
+ if (fd == NULL) {
+ LOG_ERR(PFX "Couldn't open file descriptor: %d(%s)",
+ errno, strerror(errno));
++ close(s2);
+ return -EIO;
+ }
+
+@@ -1030,7 +1034,8 @@ int process_iscsid_broadcast(int s2)
+ }
+
+ error:
+- free(data);
++ if (data)
++ free(data);
+ fclose(fd);
+
+ return rc;
+@@ -1132,8 +1137,8 @@ static void *iscsid_loop(void *arg)
+ break;
+ }
+
++ /* this closes the file descriptor s2 */
+ process_iscsid_broadcast(s2);
+- close(s2);
+ }
+
+ pthread_cleanup_pop(0);
+--
+1.9.1
+