summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSona Sarmadi <sona.sarmadi@enea.com>2017-12-13 18:39:24 +0100
committerAdrian Dudau <adrian.dudau@enea.com>2017-12-14 14:37:43 +0100
commit1a348139a77f2f0a4f564d759b37a76901c0dbdf (patch)
treec3146080146decb3bd61566a57a8a3fb188ab20a
parent1191bbadc88292d4fd9d4b1de762fb9acd57fcdf (diff)
downloadmeta-el-common-1a348139a77f2f0a4f564d759b37a76901c0dbdf.tar.gz
openssl: Fix for CVE-2017-3737
Read/write after SSL object in error state References: https://www.openssl.org/news/secadv/20171207.txt https://nvd.nist.gov/vuln/detail/CVE-2017-3737 Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com> Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
-rw-r--r--recipes-connectivity/openssl/openssl/CVE-2017-3737.patch49
-rw-r--r--recipes-connectivity/openssl/openssl_%.bbappend1
2 files changed, 50 insertions, 0 deletions
diff --git a/recipes-connectivity/openssl/openssl/CVE-2017-3737.patch b/recipes-connectivity/openssl/openssl/CVE-2017-3737.patch
new file mode 100644
index 0000000..3a7b5b2
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl/CVE-2017-3737.patch
@@ -0,0 +1,49 @@
1From 898fb884b706aaeb283de4812340bb0bde8476dc Mon Sep 17 00:00:00 2001
2From: Matt Caswell <matt@openssl.org>
3Date: Wed, 29 Nov 2017 14:04:01 +0000
4Subject: [PATCH] Don't allow read/write after fatal error
5
6OpenSSL 1.0.2 (starting from version 1.0.2b) introduced an "error state"
7mechanism. The intent was that if a fatal error occurred during a handshake
8then OpenSSL would move into the error state and would immediately fail if
9you attempted to continue the handshake. This works as designed for the
10explicit handshake functions (SSL_do_handshake(), SSL_accept() and
11SSL_connect()), however due to a bug it does not work correctly if
12SSL_read() or SSL_write() is called directly. In that scenario, if the
13handshake fails then a fatal error will be returned in the initial function
14call. If SSL_read()/SSL_write() is subsequently called by the application
15for the same SSL object then it will succeed and the data is passed without
16being decrypted/encrypted directly from the SSL/TLS record layer.
17
18In order to exploit this issue an attacker would have to trick an
19application into behaving incorrectly by issuing an SSL_read()/SSL_write()
20after having already received a fatal error.
21
22Thanks to David Benjamin (Google) for reporting this issue and suggesting
23this fix.
24
25CVE: CVE-2017-3737
26Upstream-Status: Backport
27
28Reviewed-by: Rich Salz <rsalz@openssl.org>
29Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
30---
31 ssl/ssl.h | 2 +-
32 1 file changed, 1 insertion(+), 1 deletion(-)
33
34diff --git a/ssl/ssl.h b/ssl/ssl.h
35index 90aeb0c..3cf96a2 100644
36--- a/ssl/ssl.h
37+++ b/ssl/ssl.h
38@@ -1727,7 +1727,7 @@ extern "C" {
39 # define SSL_ST_BEFORE 0x4000
40 # define SSL_ST_OK 0x03
41 # define SSL_ST_RENEGOTIATE (0x04|SSL_ST_INIT)
42-# define SSL_ST_ERR 0x05
43+# define SSL_ST_ERR (0x05|SSL_ST_INIT)
44
45 # define SSL_CB_LOOP 0x01
46 # define SSL_CB_EXIT 0x02
47--
481.9.1
49
diff --git a/recipes-connectivity/openssl/openssl_%.bbappend b/recipes-connectivity/openssl/openssl_%.bbappend
index a0b936a..7e81042 100644
--- a/recipes-connectivity/openssl/openssl_%.bbappend
+++ b/recipes-connectivity/openssl/openssl_%.bbappend
@@ -1,4 +1,5 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" 1FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2 2
3SRC_URI += "file://CVE-2017-3735.patch \ 3SRC_URI += "file://CVE-2017-3735.patch \
4 file://CVE-2017-3737.patch \
4 " 5 "