diff options
author | Zhixiong Chi <zhixiong.chi@windriver.com> | 2018-01-04 02:52:14 -0800 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2018-01-16 21:53:09 -0800 |
commit | 0ff940faabc685d890533d644130e29c24b50bd8 (patch) | |
tree | d25146458571f288e06a05230b0636dde5e795cf /meta-networking/recipes-daemons/iscsi-initiator-utils/files/0006-Skip-useless-strcopy-and-validate-CIDR-length.patch | |
parent | 8cef6b38e62e6c79ec857510df454cefc868b0df (diff) | |
download | meta-openembedded-0ff940faabc685d890533d644130e29c24b50bd8.tar.gz |
iscsi-initiator-utils: CVE-2017-17840
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>
Diffstat (limited to 'meta-networking/recipes-daemons/iscsi-initiator-utils/files/0006-Skip-useless-strcopy-and-validate-CIDR-length.patch')
-rw-r--r-- | meta-networking/recipes-daemons/iscsi-initiator-utils/files/0006-Skip-useless-strcopy-and-validate-CIDR-length.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0006-Skip-useless-strcopy-and-validate-CIDR-length.patch b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0006-Skip-useless-strcopy-and-validate-CIDR-length.patch new file mode 100644 index 0000000000..0fa24cd10d --- /dev/null +++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0006-Skip-useless-strcopy-and-validate-CIDR-length.patch @@ -0,0 +1,44 @@ +From a6efed7601c890ac051ad1425582ec67dbd3f5ff Mon Sep 17 00:00:00 2001 +From: Lee Duncan <lduncan@suse.com> +Date: Fri, 15 Dec 2017 11:18:35 -0800 +Subject: [PATCH 6/7] Skip useless strcopy, and validate CIDR length + +Remove a useless strcpy() that copies a string onto itself, +and ensure the CIDR length "keepbits" is not negative. +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 | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/iscsiuio/src/unix/iscsid_ipc.c b/iscsiuio/src/unix/iscsid_ipc.c +index 52ae8c6..85742da 100644 +--- a/iscsiuio/src/unix/iscsid_ipc.c ++++ b/iscsiuio/src/unix/iscsid_ipc.c +@@ -148,7 +148,7 @@ static int decode_cidr(char *in_ipaddr_str, struct iface_rec_decode *ird) + char *tmp, *tok; + char ipaddr_str[NI_MAXHOST]; + char str[INET6_ADDRSTRLEN]; +- int keepbits = 0; ++ unsigned long keepbits = 0; + struct in_addr ia; + struct in6_addr ia6; + +@@ -161,8 +161,7 @@ static int decode_cidr(char *in_ipaddr_str, struct iface_rec_decode *ird) + tmp = ipaddr_str; + tok = strsep(&tmp, "/"); + LOG_INFO(PFX "in cidr: bitmask '%s' ip '%s'", tmp, tok); +- keepbits = atoi(tmp); +- strcpy(ipaddr_str, tok); ++ keepbits = strtoull(tmp, NULL, 10); + } + + /* Determine if the IP address passed from the iface file is +-- +1.9.1 + |