summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster@mvista.com>2016-09-24 06:16:30 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-10-06 07:51:17 (GMT)
commit8df8e70f96bbf48b75c8ebba604b608bc30b63b2 (patch)
tree0866b27adae345910436f87b7da647f9dd220660
parentd23b450ea3090cb10a98faa7463508ca6ab24744 (diff)
downloadpoky-8df8e70f96bbf48b75c8ebba604b608bc30b63b2.tar.gz
openssl: Security fix CVE-2016-6304
affects openssl < 1.0.1i (From OE-Core rev: d6e1a56f4e764832ac84b842fa2696b56d850ee9) 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 0000000..64508b5
--- /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 436b37c..1fe0cb2 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://configure-targets.patch \
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 "
51 52
52SRC_URI[md5sum] = "9392e65072ce4b614c1392eefc1f23d0" 53SRC_URI[md5sum] = "9392e65072ce4b614c1392eefc1f23d0"