summaryrefslogtreecommitdiff
path: root/debian/patches/CVE-2017-7521bis.patch
diff options
context:
space:
mode:
authorAlberto Gonzalez Iniesta <agi@inittab.org>2017-06-22 17:25:13 +0200
committerBernhard Schmidt <berni@debian.org>2017-06-29 22:05:44 +0200
commit3e3e9b32519a38f9316986b877163d37557b4f70 (patch)
tree9ee9a4a6f2813fe4ce4623bab80d6a6c30660854 /debian/patches/CVE-2017-7521bis.patch
parentafc11370be9fd149ab361ca183c9715777b50df0 (diff)
Import Debian changes 2.3.4-5+deb8u2debian/2.3.4-5+deb8u2
openvpn (2.3.4-5+deb8u2) jessie-security; urgency=high * SECURITY UPDATE: authenticated remote DoS vulnerability due to packet ID rollover. CVE-2017-7479. Kudos to Steve Beattie <sbeattie@ubuntu.com> for doing all the backporting work for this patch. - debian/patches/CVE-2017-7479-prereq.patch: merge packet_id_alloc_outgoing() into packet_id_write() - debian/patches/CVE-2017-7479.patch: do not assert when packet ID rollover occurs * SECURITY UPDATE: (Closes: #865480) - CVE-2017-7508.patch. Fix remotely-triggerable ASSERT() on malformed IPv6 packet. - CVE-2017-7520.patch. Prevent two kinds of stack buffer OOB reads and a crash for invalid input data. - CVE-2017-7521.patch. Fix potential double-free in --x509-alt-username. - CVE-2017-7521bis.patch. Fix remote-triggerable memory leaks.
Diffstat (limited to 'debian/patches/CVE-2017-7521bis.patch')
-rw-r--r--debian/patches/CVE-2017-7521bis.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/debian/patches/CVE-2017-7521bis.patch b/debian/patches/CVE-2017-7521bis.patch
new file mode 100644
index 0000000..a986ef0
--- /dev/null
+++ b/debian/patches/CVE-2017-7521bis.patch
@@ -0,0 +1,74 @@
+commit 84e1775961de1c9d2ab32159fc03f758591f5238
+Author: Steffan Karger <steffan.karger@fox-it.com>
+Date: Mon Jun 19 11:28:38 2017 +0200
+
+ Fix remote-triggerable memory leaks (CVE-2017-7521)
+
+ Several of our OpenSSL-specific certificate-parsing code paths did not
+ always clear all allocated memory. Since a client can cause a few bytes
+ of memory to be leaked for each connection attempt, a client can cause a
+ server to run out of memory and thereby kill the server. That makes this
+ a (quite inefficient) DoS attack.
+
+ When using the --x509-alt-username option on openssl builds with an
+ extension (argument prefixed with "ext:", e.g. "ext:subjectAltName"), the
+ code would not free all allocated memory. Fix this by using the proper
+ free function.
+
+ If ASN1_STRING_to_UTF8() returns 0, it didn't fail and *did* allocate
+ memory. So also free the returned buffer if it returns 0.
+
+ These issues were found, analysed and reported to the OpenVPN team by Guido
+ Vranken.
+
+ CVE: 2017-7521
+ Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
+ Acked-by: Gert Doering <gert@greenie.muc.de>
+ Acked-by: David Sommerseth <davids@openvpn.net>
+ Acked-by: Guido Vranken <guidovranken@gmail.com>
+ Message-Id: <1497864520-12219-4-git-send-email-steffan.karger@fox-it.com>
+ URL: https://www.mail-archive.com/search?l=mid&q=1497864520-12219-4-git-send-email-steffan.karger@fox-it.com
+ Signed-off-by: Gert Doering <gert@greenie.muc.de>
+ (cherry picked from commit 2d032c7fcdfd692c851ea2fa858b4c2d9ea7d52d)
+
+Index: openvpn-2.3.4/src/openvpn/ssl_verify_openssl.c
+===================================================================
+--- openvpn-2.3.4.orig/src/openvpn/ssl_verify_openssl.c
++++ openvpn-2.3.4/src/openvpn/ssl_verify_openssl.c
+@@ -144,7 +144,7 @@ bool extract_x509_extension(X509 *cert,
+ break;
+ }
+ }
+- sk_GENERAL_NAME_free (extensions);
++ GENERAL_NAMES_free(extensions);
+ }
+ return retval;
+ }
+@@ -191,8 +191,7 @@ extract_x509_field_ssl (X509_NAME *x509,
+ asn1 = X509_NAME_ENTRY_get_data(x509ne);
+ if (!asn1)
+ return FAILURE;
+- tmp = ASN1_STRING_to_UTF8(&buf, asn1);
+- if (tmp <= 0)
++ if (ASN1_STRING_to_UTF8(&buf, asn1) < 0)
+ return FAILURE;
+
+ strncpynt(out, (char *)buf, size);
+@@ -364,7 +363,7 @@ x509_setenv_track (const struct x509_tra
+ ASN1_STRING *val = X509_NAME_ENTRY_get_data (ent);
+ unsigned char *buf;
+ buf = (unsigned char *)1; /* bug in OpenSSL 0.9.6b ASN1_STRING_to_UTF8 requires this workaround */
+- if (ASN1_STRING_to_UTF8 (&buf, val) > 0)
++ if (ASN1_STRING_to_UTF8 (&buf, val) >= 0)
+ {
+ do_setenv_x509(es, xt->name, (char *)buf, depth);
+ OPENSSL_free (buf);
+@@ -440,7 +439,7 @@ x509_setenv (struct env_set *es, int cer
+ if (!objbuf)
+ continue;
+ buf = (unsigned char *)1; /* bug in OpenSSL 0.9.6b ASN1_STRING_to_UTF8 requires this workaround */
+- if (ASN1_STRING_to_UTF8 (&buf, val) <= 0)
++ if (ASN1_STRING_to_UTF8 (&buf, val) < 0)
+ continue;
+ name_expand_size = 64 + strlen (objbuf);
+ name_expand = (char *) malloc (name_expand_size);