aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2017-11-18 09:53:57 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-02 11:24:35 +0000
commite76dcfbd6e1ad6fc147a0607dcdaf8e7ea98b610 (patch)
tree7bb381a035bf7d5766f20b36c112856d98821722
parentedf9686be28fc321886d48043bcb4ef5b2c00c1d (diff)
downloadopenembedded-core-e76dcfbd6e1ad6fc147a0607dcdaf8e7ea98b610.tar.gz
openembedded-core-e76dcfbd6e1ad6fc147a0607dcdaf8e7ea98b610.tar.bz2
openembedded-core-e76dcfbd6e1ad6fc147a0607dcdaf8e7ea98b610.zip
openssl: fix runtime errors with Thumb2 when using binutils 2.29
When compiling OpenSSL with binutils 2.29 for ARM with Thumb2 enabled crashes and unexpected behavior occurs. E.g. connecting to a OpenSSH server using the affected binary fails with: ssh_dispatch_run_fatal: Connection to 192.168.10.171 port 22: incorrect signature Backport upstream bugfix: https://github.com/openssl/openssl/issues/4659 Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/recipes-connectivity/openssl/openssl/0001-aes-asm-aes-armv4-bsaes-armv7-.pl-make-it-work-with-.patch88
-rw-r--r--meta/recipes-connectivity/openssl/openssl_1.1.0g.bb1
2 files changed, 89 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl/0001-aes-asm-aes-armv4-bsaes-armv7-.pl-make-it-work-with-.patch b/meta/recipes-connectivity/openssl/openssl/0001-aes-asm-aes-armv4-bsaes-armv7-.pl-make-it-work-with-.patch
new file mode 100644
index 0000000000..bb0a1689ed
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/0001-aes-asm-aes-armv4-bsaes-armv7-.pl-make-it-work-with-.patch
@@ -0,0 +1,88 @@
+From bcc096a50811bf0f0c4fd34b2993fed7a7015972 Mon Sep 17 00:00:00 2001
+From: Andy Polyakov <appro@openssl.org>
+Date: Fri, 3 Nov 2017 23:30:01 +0100
+Subject: [PATCH] aes/asm/{aes-armv4|bsaes-armv7}.pl: make it work with
+ binutils-2.29.
+
+It's not clear if it's a feature or bug, but binutils-2.29[.1]
+interprets 'adr' instruction with Thumb2 code reference differently,
+in a way that affects calculation of addresses of constants' tables.
+
+Upstream-Status: Backport
+
+Reviewed-by: Tim Hudson <tjh@openssl.org>
+Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
+Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
+(Merged from https://github.com/openssl/openssl/pull/4669)
+
+(cherry picked from commit b82acc3c1a7f304c9df31841753a0fa76b5b3cda)
+---
+ crypto/aes/asm/aes-armv4.pl | 6 +++---
+ crypto/aes/asm/bsaes-armv7.pl | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/crypto/aes/asm/aes-armv4.pl b/crypto/aes/asm/aes-armv4.pl
+index 16d79aae53..c6474b8aad 100644
+--- a/crypto/aes/asm/aes-armv4.pl
++++ b/crypto/aes/asm/aes-armv4.pl
+@@ -200,7 +200,7 @@ AES_encrypt:
+ #ifndef __thumb2__
+ sub r3,pc,#8 @ AES_encrypt
+ #else
+- adr r3,AES_encrypt
++ adr r3,.
+ #endif
+ stmdb sp!,{r1,r4-r12,lr}
+ #ifdef __APPLE__
+@@ -450,7 +450,7 @@ _armv4_AES_set_encrypt_key:
+ #ifndef __thumb2__
+ sub r3,pc,#8 @ AES_set_encrypt_key
+ #else
+- adr r3,AES_set_encrypt_key
++ adr r3,.
+ #endif
+ teq r0,#0
+ #ifdef __thumb2__
+@@ -976,7 +976,7 @@ AES_decrypt:
+ #ifndef __thumb2__
+ sub r3,pc,#8 @ AES_decrypt
+ #else
+- adr r3,AES_decrypt
++ adr r3,.
+ #endif
+ stmdb sp!,{r1,r4-r12,lr}
+ #ifdef __APPLE__
+diff --git a/crypto/aes/asm/bsaes-armv7.pl b/crypto/aes/asm/bsaes-armv7.pl
+index 9f288660ef..a27bb4a179 100644
+--- a/crypto/aes/asm/bsaes-armv7.pl
++++ b/crypto/aes/asm/bsaes-armv7.pl
+@@ -744,7 +744,7 @@ $code.=<<___;
+ .type _bsaes_decrypt8,%function
+ .align 4
+ _bsaes_decrypt8:
+- adr $const,_bsaes_decrypt8
++ adr $const,.
+ vldmia $key!, {@XMM[9]} @ round 0 key
+ #ifdef __APPLE__
+ adr $const,.LM0ISR
+@@ -843,7 +843,7 @@ _bsaes_const:
+ .type _bsaes_encrypt8,%function
+ .align 4
+ _bsaes_encrypt8:
+- adr $const,_bsaes_encrypt8
++ adr $const,.
+ vldmia $key!, {@XMM[9]} @ round 0 key
+ #ifdef __APPLE__
+ adr $const,.LM0SR
+@@ -951,7 +951,7 @@ $code.=<<___;
+ .type _bsaes_key_convert,%function
+ .align 4
+ _bsaes_key_convert:
+- adr $const,_bsaes_key_convert
++ adr $const,.
+ vld1.8 {@XMM[7]}, [$inp]! @ load round 0 key
+ #ifdef __APPLE__
+ adr $const,.LM0
+--
+2.15.0
+
diff --git a/meta/recipes-connectivity/openssl/openssl_1.1.0g.bb b/meta/recipes-connectivity/openssl/openssl_1.1.0g.bb
index c85a1d27a2..53f397a3e0 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.1.0g.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.1.0g.bb
@@ -18,6 +18,7 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
file://openssl-c_rehash.sh \
file://0001-Take-linking-flags-from-LDFLAGS-env-var.patch \
file://0001-Remove-test-that-requires-running-as-non-root.patch \
+ file://0001-aes-asm-aes-armv4-bsaes-armv7-.pl-make-it-work-with-.patch \
"
S = "${WORKDIR}/openssl-${PV}"