diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2017-12-19 22:26:37 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-06 10:13:55 +0000 |
commit | 8401bae6aa337d4ff8b3118d29c29523594a910d (patch) | |
tree | 304428f84f22320889ae4f433d8730d66f9b5b25 /meta/recipes-connectivity | |
parent | 2b2d6b6c1bbd1d7844b9ab658c6486752476cd88 (diff) | |
download | poky-8401bae6aa337d4ff8b3118d29c29523594a910d.tar.gz |
openssl10: 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
(From OE-Core rev: 7310bdb8709a8cb9a5653f10d0be1c024daf6f03)
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity')
-rw-r--r-- | meta/recipes-connectivity/openssl/openssl-1.0.2m/0001-aes-armv4-bsaes-armv7-sha256-armv4-.pl-make-it-work-.patch | 100 | ||||
-rw-r--r-- | meta/recipes-connectivity/openssl/openssl_1.0.2m.bb | 1 |
2 files changed, 101 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl-1.0.2m/0001-aes-armv4-bsaes-armv7-sha256-armv4-.pl-make-it-work-.patch b/meta/recipes-connectivity/openssl/openssl-1.0.2m/0001-aes-armv4-bsaes-armv7-sha256-armv4-.pl-make-it-work-.patch new file mode 100644 index 0000000000..2ce0320c49 --- /dev/null +++ b/meta/recipes-connectivity/openssl/openssl-1.0.2m/0001-aes-armv4-bsaes-armv7-sha256-armv4-.pl-make-it-work-.patch | |||
@@ -0,0 +1,100 @@ | |||
1 | From d1d6c69b6fd25e71dbae67fad17b2c7737f6b2dc Mon Sep 17 00:00:00 2001 | ||
2 | From: Andy Polyakov <appro@openssl.org> | ||
3 | Date: Sun, 5 Nov 2017 17:08:16 +0100 | ||
4 | Subject: [PATCH] {aes-armv4|bsaes-armv7|sha256-armv4}.pl: make it work with | ||
5 | binutils-2.29 | ||
6 | |||
7 | It's not clear if it's a feature or bug, but binutils-2.29[.1] | ||
8 | interprets 'adr' instruction with Thumb2 code reference differently, | ||
9 | in a way that affects calculation of addresses of constants' tables. | ||
10 | |||
11 | Upstream-Status: Backport | ||
12 | |||
13 | Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> | ||
14 | Reviewed-by: Kurt Roeckx <kurt@roeckx.be> | ||
15 | Signed-off-by: Stefan Agner <stefan.agner@toradex.com> | ||
16 | (Merged from https://github.com/openssl/openssl/pull/4673) | ||
17 | --- | ||
18 | crypto/aes/asm/aes-armv4.pl | 6 +++--- | ||
19 | crypto/aes/asm/bsaes-armv7.pl | 6 +++--- | ||
20 | crypto/sha/asm/sha256-armv4.pl | 2 +- | ||
21 | 3 files changed, 7 insertions(+), 7 deletions(-) | ||
22 | |||
23 | diff --git a/crypto/aes/asm/aes-armv4.pl b/crypto/aes/asm/aes-armv4.pl | ||
24 | index 4f8917089f..c1b5e352d7 100644 | ||
25 | --- a/crypto/aes/asm/aes-armv4.pl | ||
26 | +++ b/crypto/aes/asm/aes-armv4.pl | ||
27 | @@ -184,7 +184,7 @@ AES_encrypt: | ||
28 | #if __ARM_ARCH__<7 | ||
29 | sub r3,pc,#8 @ AES_encrypt | ||
30 | #else | ||
31 | - adr r3,AES_encrypt | ||
32 | + adr r3,. | ||
33 | #endif | ||
34 | stmdb sp!,{r1,r4-r12,lr} | ||
35 | mov $rounds,r0 @ inp | ||
36 | @@ -430,7 +430,7 @@ _armv4_AES_set_encrypt_key: | ||
37 | #if __ARM_ARCH__<7 | ||
38 | sub r3,pc,#8 @ AES_set_encrypt_key | ||
39 | #else | ||
40 | - adr r3,private_AES_set_encrypt_key | ||
41 | + adr r3,. | ||
42 | #endif | ||
43 | teq r0,#0 | ||
44 | #if __ARM_ARCH__>=7 | ||
45 | @@ -952,7 +952,7 @@ AES_decrypt: | ||
46 | #if __ARM_ARCH__<7 | ||
47 | sub r3,pc,#8 @ AES_decrypt | ||
48 | #else | ||
49 | - adr r3,AES_decrypt | ||
50 | + adr r3,. | ||
51 | #endif | ||
52 | stmdb sp!,{r1,r4-r12,lr} | ||
53 | mov $rounds,r0 @ inp | ||
54 | diff --git a/crypto/aes/asm/bsaes-armv7.pl b/crypto/aes/asm/bsaes-armv7.pl | ||
55 | index 70b3f9656f..ec66b0502a 100644 | ||
56 | --- a/crypto/aes/asm/bsaes-armv7.pl | ||
57 | +++ b/crypto/aes/asm/bsaes-armv7.pl | ||
58 | @@ -724,7 +724,7 @@ $code.=<<___; | ||
59 | .type _bsaes_decrypt8,%function | ||
60 | .align 4 | ||
61 | _bsaes_decrypt8: | ||
62 | - adr $const,_bsaes_decrypt8 | ||
63 | + adr $const,. | ||
64 | vldmia $key!, {@XMM[9]} @ round 0 key | ||
65 | add $const,$const,#.LM0ISR-_bsaes_decrypt8 | ||
66 | |||
67 | @@ -819,7 +819,7 @@ _bsaes_const: | ||
68 | .type _bsaes_encrypt8,%function | ||
69 | .align 4 | ||
70 | _bsaes_encrypt8: | ||
71 | - adr $const,_bsaes_encrypt8 | ||
72 | + adr $const,. | ||
73 | vldmia $key!, {@XMM[9]} @ round 0 key | ||
74 | sub $const,$const,#_bsaes_encrypt8-.LM0SR | ||
75 | |||
76 | @@ -923,7 +923,7 @@ $code.=<<___; | ||
77 | .type _bsaes_key_convert,%function | ||
78 | .align 4 | ||
79 | _bsaes_key_convert: | ||
80 | - adr $const,_bsaes_key_convert | ||
81 | + adr $const,. | ||
82 | vld1.8 {@XMM[7]}, [$inp]! @ load round 0 key | ||
83 | sub $const,$const,#_bsaes_key_convert-.LM0 | ||
84 | vld1.8 {@XMM[15]}, [$inp]! @ load round 1 key | ||
85 | diff --git a/crypto/sha/asm/sha256-armv4.pl b/crypto/sha/asm/sha256-armv4.pl | ||
86 | index 4fee74d832..750216eb42 100644 | ||
87 | --- a/crypto/sha/asm/sha256-armv4.pl | ||
88 | +++ b/crypto/sha/asm/sha256-armv4.pl | ||
89 | @@ -205,7 +205,7 @@ sha256_block_data_order: | ||
90 | #if __ARM_ARCH__<7 | ||
91 | sub r3,pc,#8 @ sha256_block_data_order | ||
92 | #else | ||
93 | - adr r3,sha256_block_data_order | ||
94 | + adr r3,. | ||
95 | #endif | ||
96 | #if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__) | ||
97 | ldr r12,.LOPENSSL_armcap | ||
98 | -- | ||
99 | 2.15.0 | ||
100 | |||
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.2m.bb b/meta/recipes-connectivity/openssl/openssl_1.0.2m.bb index 04763ac346..9270f52bc6 100644 --- a/meta/recipes-connectivity/openssl/openssl_1.0.2m.bb +++ b/meta/recipes-connectivity/openssl/openssl_1.0.2m.bb | |||
@@ -42,6 +42,7 @@ SRC_URI += "file://find.pl;subdir=openssl-${PV}/util/ \ | |||
42 | file://Use-SHA256-not-MD5-as-default-digest.patch \ | 42 | file://Use-SHA256-not-MD5-as-default-digest.patch \ |
43 | file://0001-Fix-build-with-clang-using-external-assembler.patch \ | 43 | file://0001-Fix-build-with-clang-using-external-assembler.patch \ |
44 | file://0001-openssl-force-soft-link-to-avoid-rare-race.patch \ | 44 | file://0001-openssl-force-soft-link-to-avoid-rare-race.patch \ |
45 | file://0001-aes-armv4-bsaes-armv7-sha256-armv4-.pl-make-it-work-.patch \ | ||
45 | " | 46 | " |
46 | SRC_URI[md5sum] = "10e9e37f492094b9ef296f68f24a7666" | 47 | SRC_URI[md5sum] = "10e9e37f492094b9ef296f68f24a7666" |
47 | SRC_URI[sha256sum] = "8c6ff15ec6b319b50788f42c7abc2890c08ba5a1cdcd3810eb9092deada37b0f" | 48 | SRC_URI[sha256sum] = "8c6ff15ec6b319b50788f42c7abc2890c08ba5a1cdcd3810eb9092deada37b0f" |