summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssl
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/openssl')
-rw-r--r--meta/recipes-connectivity/openssl/openssl/bti.patch58
-rw-r--r--meta/recipes-connectivity/openssl/openssl_3.3.0.bb (renamed from meta/recipes-connectivity/openssl/openssl_3.2.1.bb)3
2 files changed, 60 insertions, 1 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl/bti.patch b/meta/recipes-connectivity/openssl/openssl/bti.patch
new file mode 100644
index 0000000000..748576c30c
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/bti.patch
@@ -0,0 +1,58 @@
1From ba8a599395f8b770c76316b5f5b0f3838567014f Mon Sep 17 00:00:00 2001
2From: Tom Cosgrove <tom.cosgrove@arm.com>
3Date: Tue, 26 Mar 2024 13:18:00 +0000
4Subject: [PATCH] aarch64: fix BTI in bsaes assembly code
5
6In Arm systems where BTI is enabled but the Crypto extensions are not (more
7likely in FVPs than in real hardware), the bit-sliced assembler code will
8be used. However, this wasn't annotated with BTI instructions when BTI was
9enabled, so the moment libssl jumps into this code it (correctly) aborts.
10
11Solve this by adding the missing BTI landing pads.
12
13Upstream-Status: Submitted [https://github.com/openssl/openssl/pull/23982]
14Signed-off-by: Ross Burton <ross.burton@arm.com>
15---
16 crypto/aes/asm/bsaes-armv8.pl | 5 ++++-
17 1 file changed, 4 insertions(+), 1 deletion(-)
18
19diff --git a/crypto/aes/asm/bsaes-armv8.pl b/crypto/aes/asm/bsaes-armv8.pl
20index b3c97e439f..c3c5ff3e05 100644
21--- a/crypto/aes/asm/bsaes-armv8.pl
22+++ b/crypto/aes/asm/bsaes-armv8.pl
23@@ -1018,6 +1018,7 @@ _bsaes_key_convert:
24 // Initialisation vector overwritten with last quadword of ciphertext
25 // No output registers, usual AAPCS64 register preservation
26 ossl_bsaes_cbc_encrypt:
27+ AARCH64_VALID_CALL_TARGET
28 cmp x2, #128
29 bhs .Lcbc_do_bsaes
30 b AES_cbc_encrypt
31@@ -1270,7 +1271,7 @@ ossl_bsaes_cbc_encrypt:
32 // Output text filled in
33 // No output registers, usual AAPCS64 register preservation
34 ossl_bsaes_ctr32_encrypt_blocks:
35-
36+ AARCH64_VALID_CALL_TARGET
37 cmp x2, #8 // use plain AES for
38 blo .Lctr_enc_short // small sizes
39
40@@ -1476,6 +1477,7 @@ ossl_bsaes_ctr32_encrypt_blocks:
41 // Output ciphertext filled in
42 // No output registers, usual AAPCS64 register preservation
43 ossl_bsaes_xts_encrypt:
44+ AARCH64_VALID_CALL_TARGET
45 // Stack layout:
46 // sp ->
47 // nrounds*128-96 bytes: key schedule
48@@ -1921,6 +1923,7 @@ ossl_bsaes_xts_encrypt:
49 // Output plaintext filled in
50 // No output registers, usual AAPCS64 register preservation
51 ossl_bsaes_xts_decrypt:
52+ AARCH64_VALID_CALL_TARGET
53 // Stack layout:
54 // sp ->
55 // nrounds*128-96 bytes: key schedule
56--
572.34.1
58
diff --git a/meta/recipes-connectivity/openssl/openssl_3.2.1.bb b/meta/recipes-connectivity/openssl/openssl_3.3.0.bb
index 1682b6f8cc..2cdaf4c75d 100644
--- a/meta/recipes-connectivity/openssl/openssl_3.2.1.bb
+++ b/meta/recipes-connectivity/openssl/openssl_3.3.0.bb
@@ -12,13 +12,14 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
12 file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \ 12 file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \
13 file://0001-Configure-do-not-tweak-mips-cflags.patch \ 13 file://0001-Configure-do-not-tweak-mips-cflags.patch \
14 file://0001-Added-handshake-history-reporting-when-test-fails.patch \ 14 file://0001-Added-handshake-history-reporting-when-test-fails.patch \
15 file://bti.patch \
15 " 16 "
16 17
17SRC_URI:append:class-nativesdk = " \ 18SRC_URI:append:class-nativesdk = " \
18 file://environment.d-openssl.sh \ 19 file://environment.d-openssl.sh \
19 " 20 "
20 21
21SRC_URI[sha256sum] = "83c7329fe52c850677d75e5d0b0ca245309b97e8ecbcfdc1dfdc4ab9fac35b39" 22SRC_URI[sha256sum] = "53e66b043322a606abf0087e7699a0e033a37fa13feb9742df35c3a33b18fb02"
22 23
23inherit lib_package multilib_header multilib_script ptest perlnative manpages 24inherit lib_package multilib_header multilib_script ptest perlnative manpages
24MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash" 25MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash"