summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster@mvista.com>2016-09-23 23:16:30 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-27 09:05:57 +0100
commite08094e604caf1fceb1fba7a4cae0f1937ffe7ef (patch)
treea25d7d69ed36069a5aadfb634ed84342dc1ca5a1
parent5f97311702afa5b942f0c3f71cf74292b6eae365 (diff)
downloadpoky-e08094e604caf1fceb1fba7a4cae0f1937ffe7ef.tar.gz
openssl: Security fix CVE-2016-6304
affects openssl < 1.0.1i (From OE-Core rev: ae1db7aea891978e42e5205d2ffc93c16703134c) Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-connectivity/openssl/openssl/CVE-2016-6304.patch75
-rw-r--r--meta/recipes-connectivity/openssl/openssl_1.0.2h.bb1
2 files changed, 76 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl/CVE-2016-6304.patch b/meta/recipes-connectivity/openssl/openssl/CVE-2016-6304.patch
new file mode 100644
index 0000000000..64508b57c2
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/CVE-2016-6304.patch
@@ -0,0 +1,75 @@
1From ea39b16b71e4e72a228a4535bd6d6a02c5edbc1f Mon Sep 17 00:00:00 2001
2From: Matt Caswell <matt@openssl.org>
3Date: Fri, 9 Sep 2016 10:08:45 +0100
4Subject: [PATCH] Fix OCSP Status Request extension unbounded memory growth
5
6A malicious client can send an excessively large OCSP Status Request
7extension. If that client continually requests renegotiation,
8sending a large OCSP Status Request extension each time, then there will
9be unbounded memory growth on the server. This will eventually lead to a
10Denial Of Service attack through memory exhaustion. Servers with a
11default configuration are vulnerable even if they do not support OCSP.
12Builds using the "no-ocsp" build time option are not affected.
13
14I have also checked other extensions to see if they suffer from a similar
15problem but I could not find any other issues.
16
17CVE-2016-6304
18
19Issue reported by Shi Lei.
20
21Reviewed-by: Rich Salz <rsalz@openssl.org>
22
23Upstream-Status: Backport
24CVE: CVE-2016-6304
25Signed-off-by: Armin Kuster <akuster@mvista.com>
26
27---
28 ssl/t1_lib.c | 24 +++++++++++++++++-------
29 1 file changed, 17 insertions(+), 7 deletions(-)
30
31diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c
32index fbcf2e6..e4b4e27 100644
33--- a/ssl/t1_lib.c
34+++ b/ssl/t1_lib.c
35@@ -2316,6 +2316,23 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p,
36 size -= 2;
37 if (dsize > size)
38 goto err;
39+
40+ /*
41+ * We remove any OCSP_RESPIDs from a previous handshake
42+ * to prevent unbounded memory growth - CVE-2016-6304
43+ */
44+ sk_OCSP_RESPID_pop_free(s->tlsext_ocsp_ids,
45+ OCSP_RESPID_free);
46+ if (dsize > 0) {
47+ s->tlsext_ocsp_ids = sk_OCSP_RESPID_new_null();
48+ if (s->tlsext_ocsp_ids == NULL) {
49+ *al = SSL_AD_INTERNAL_ERROR;
50+ return 0;
51+ }
52+ } else {
53+ s->tlsext_ocsp_ids = NULL;
54+ }
55+
56 while (dsize > 0) {
57 OCSP_RESPID *id;
58 int idsize;
59@@ -2335,13 +2352,6 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p,
60 OCSP_RESPID_free(id);
61 goto err;
62 }
63- if (!s->tlsext_ocsp_ids
64- && !(s->tlsext_ocsp_ids =
65- sk_OCSP_RESPID_new_null())) {
66- OCSP_RESPID_free(id);
67- *al = SSL_AD_INTERNAL_ERROR;
68- return 0;
69- }
70 if (!sk_OCSP_RESPID_push(s->tlsext_ocsp_ids, id)) {
71 OCSP_RESPID_free(id);
72 *al = SSL_AD_INTERNAL_ERROR;
73--
742.7.4
75
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.2h.bb b/meta/recipes-connectivity/openssl/openssl_1.0.2h.bb
index 2e42e173a2..a12f59d18a 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.0.2h.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.0.2h.bb
@@ -47,6 +47,7 @@ SRC_URI += "file://find.pl;subdir=${BP}/util/ \
47 file://CVE-2016-2182.patch \ 47 file://CVE-2016-2182.patch \
48 file://CVE-2016-6302.patch \ 48 file://CVE-2016-6302.patch \
49 file://CVE-2016-6303.patch \ 49 file://CVE-2016-6303.patch \
50 file://CVE-2016-6304.patch \
50 " 51 "
51SRC_URI[md5sum] = "9392e65072ce4b614c1392eefc1f23d0" 52SRC_URI[md5sum] = "9392e65072ce4b614c1392eefc1f23d0"
52SRC_URI[sha256sum] = "1d4007e53aad94a5b2002fe045ee7bb0b3d98f1a47f8b2bc851dcd1c74332919" 53SRC_URI[sha256sum] = "1d4007e53aad94a5b2002fe045ee7bb0b3d98f1a47f8b2bc851dcd1c74332919"