aboutsummaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2024-03-06 04:01:57 -0600
committerBrent Cook <busterb@gmail.com>2024-03-06 04:01:57 -0600
commit56b50e19a75e66c93888106b77e5b5cdcd6e766c (patch)
tree152765f35a7673819c7191b6f5b87a70985da1b6 /patches
parent3a8d7ef299f94e38eeeedfdc101bb486f4720d18 (diff)
downloadportable-56b50e19a75e66c93888106b77e5b5cdcd6e766c.tar.gz
portable-56b50e19a75e66c93888106b77e5b5cdcd6e766c.tar.bz2
portable-56b50e19a75e66c93888106b77e5b5cdcd6e766c.zip
update endbr64 fixes from upstream
Diffstat (limited to 'patches')
-rw-r--r--patches/asm/0001-Add-a-few-missing-endbr64-to-libcrypto.patch74
-rw-r--r--patches/asm/0001-Replace-uses-of-endbr64-with-_CET_ENDBR-from-cet.h.patch (renamed from patches/asm/endbr64.patch)404
2 files changed, 265 insertions, 213 deletions
diff --git a/patches/asm/0001-Add-a-few-missing-endbr64-to-libcrypto.patch b/patches/asm/0001-Add-a-few-missing-endbr64-to-libcrypto.patch
new file mode 100644
index 0000000..3fe5594
--- /dev/null
+++ b/patches/asm/0001-Add-a-few-missing-endbr64-to-libcrypto.patch
@@ -0,0 +1,74 @@
1From cdcdc3f000a66ef2634f3b9ffef752eaab42c119 Mon Sep 17 00:00:00 2001
2From: tb <>
3Date: Sat, 24 Feb 2024 17:53:20 +0000
4Subject: [PATCH] Add a few missing endbr64 to libcrypto
5
6gcm_{gmult,ghash}_4bit(), aesni_ccm64_decrypt_blocks(), aes_cbc_encrypt(),
7and aesni_xts_{en,de}crypt() were overlooked in previous passes.
8
9Found with a diff for ld.lld by kettenis
10ok kettenis
11---
12 src/lib/libcrypto/aes/asm/aesni-x86_64.pl | 4 ++++
13 src/lib/libcrypto/modes/asm/ghash-x86_64.pl | 2 ++
14 2 files changed, 6 insertions(+)
15
16diff --git a/src/lib/libcrypto/aes/asm/aesni-x86_64.pl b/src/lib/libcrypto/aes/asm/aesni-x86_64.pl
17index 43013a51f..441524036 100644
18--- a/src/lib/libcrypto/aes/asm/aesni-x86_64.pl
19+++ b/src/lib/libcrypto/aes/asm/aesni-x86_64.pl
20@@ -918,6 +918,7 @@ $code.=<<___;
21 .type aesni_ccm64_decrypt_blocks,\@function,6
22 .align 16
23 aesni_ccm64_decrypt_blocks:
24+ _CET_ENDBR
25 ___
26 $code.=<<___ if ($win64);
27 lea -0x58(%rsp),%rsp
28@@ -1317,6 +1318,7 @@ $code.=<<___;
29 .type aesni_xts_encrypt,\@function,6
30 .align 16
31 aesni_xts_encrypt:
32+ _CET_ENDBR
33 lea (%rsp),%rax
34 push %rbp
35 sub \$$frame_size,%rsp
36@@ -1711,6 +1713,7 @@ $code.=<<___;
37 .type aesni_xts_decrypt,\@function,6
38 .align 16
39 aesni_xts_decrypt:
40+ _CET_ENDBR
41 lea (%rsp),%rax
42 push %rbp
43 sub \$$frame_size,%rsp
44@@ -2148,6 +2151,7 @@ $code.=<<___;
45 .type ${PREFIX}_cbc_encrypt,\@function,6
46 .align 16
47 ${PREFIX}_cbc_encrypt:
48+ _CET_ENDBR
49 test $len,$len # check length
50 jz .Lcbc_ret
51
52diff --git a/src/lib/libcrypto/modes/asm/ghash-x86_64.pl b/src/lib/libcrypto/modes/asm/ghash-x86_64.pl
53index f3caac15d..bf547a041 100644
54--- a/src/lib/libcrypto/modes/asm/ghash-x86_64.pl
55+++ b/src/lib/libcrypto/modes/asm/ghash-x86_64.pl
56@@ -165,6 +165,7 @@ $code=<<___;
57 .type gcm_gmult_4bit,\@function,2
58 .align 16
59 gcm_gmult_4bit:
60+ _CET_ENDBR
61 push %rbx
62 push %rbp # %rbp and %r12 are pushed exclusively in
63 push %r12 # order to reuse Win64 exception handler...
64@@ -195,6 +196,7 @@ $code.=<<___;
65 .type gcm_ghash_4bit,\@function,4
66 .align 16
67 gcm_ghash_4bit:
68+ _CET_ENDBR
69 push %rbx
70 push %rbp
71 push %r12
72--
732.43.0
74
diff --git a/patches/asm/endbr64.patch b/patches/asm/0001-Replace-uses-of-endbr64-with-_CET_ENDBR-from-cet.h.patch
index 05cf0eb..58e9cb3 100644
--- a/patches/asm/endbr64.patch
+++ b/patches/asm/0001-Replace-uses-of-endbr64-with-_CET_ENDBR-from-cet.h.patch
@@ -1,42 +1,51 @@
1Replace uses of endbr64 with _CET_ENDBR from cet.h 1From c10c5b524e3121f42c9239d737dd7f975638f378 Mon Sep 17 00:00:00 2001
2From: tb <>
3Date: Sat, 24 Feb 2024 15:30:14 +0000
4Subject: [PATCH] Replace uses of endbr64 with _CET_ENDBR from cet.h
2 5
3cet.h is needed for other platforms to emit the relevant .gnu.properties 6cet.h is needed for other platforms to emit the relevant .gnu.properties
4sections that are necessary for them to enable IBT. It also avoids issues 7sections that are necessary for them to enable IBT. It also avoids issues
5with older toolchains on macOS that explode on encountering endbr64. 8with older toolchains on macOS that explode on encountering endbr64.
6 9
7based on a diff by kettenis 10based on a diff by kettenis
8ok beck kettenis tb 11ok beck kettenis
12---
13 src/lib/libcrypto/aes/asm/aes-x86_64.pl | 26 +++++++--------
14 .../libcrypto/aes/asm/aesni-sha1-x86_64.pl | 8 ++---
15 src/lib/libcrypto/aes/asm/aesni-x86_64.pl | 32 +++++++++----------
16 src/lib/libcrypto/aes/asm/bsaes-x86_64.pl | 28 ++++++++--------
17 src/lib/libcrypto/aes/asm/vpaes-x86_64.pl | 28 ++++++++--------
18 src/lib/libcrypto/bn/arch/amd64/bignum_add.S | 2 +-
19 .../libcrypto/bn/arch/amd64/bignum_cmadd.S | 2 +-
20 src/lib/libcrypto/bn/arch/amd64/bignum_cmul.S | 2 +-
21 src/lib/libcrypto/bn/arch/amd64/bignum_mul.S | 2 +-
22 .../bn/arch/amd64/bignum_mul_4_8_alt.S | 2 +-
23 .../bn/arch/amd64/bignum_mul_8_16_alt.S | 2 +-
24 src/lib/libcrypto/bn/arch/amd64/bignum_sqr.S | 2 +-
25 .../bn/arch/amd64/bignum_sqr_4_8_alt.S | 2 +-
26 .../bn/arch/amd64/bignum_sqr_8_16_alt.S | 2 +-
27 src/lib/libcrypto/bn/arch/amd64/bignum_sub.S | 2 +-
28 src/lib/libcrypto/bn/arch/amd64/word_clz.S | 2 +-
29 src/lib/libcrypto/bn/asm/modexp512-x86_64.pl | 10 +++---
30 src/lib/libcrypto/bn/asm/x86_64-mont.pl | 6 ++--
31 src/lib/libcrypto/bn/asm/x86_64-mont5.pl | 10 +++---
32 src/lib/libcrypto/bn/s2n_bignum_internal.h | 6 ++++
33 src/lib/libcrypto/camellia/asm/cmll-x86_64.pl | 16 +++++-----
34 src/lib/libcrypto/md5/asm/md5-x86_64.pl | 2 +-
35 src/lib/libcrypto/modes/asm/ghash-x86_64.pl | 8 ++---
36 src/lib/libcrypto/perlasm/x86_64-xlate.pl | 16 ++++++++++
37 src/lib/libcrypto/rc4/asm/rc4-md5-x86_64.pl | 4 +--
38 src/lib/libcrypto/rc4/asm/rc4-x86_64.pl | 4 +--
39 src/lib/libcrypto/sha/asm/sha1-x86_64.pl | 8 ++---
40 src/lib/libcrypto/sha/asm/sha512-x86_64.pl | 2 +-
41 src/lib/libcrypto/whrlpool/asm/wp-x86_64.pl | 2 +-
42 src/lib/libcrypto/x86_64cpuid.pl | 4 +--
43 30 files changed, 132 insertions(+), 110 deletions(-)
9 44
10Index: x86_64cpuid.pl 45diff --git a/src/lib/libcrypto/aes/asm/aes-x86_64.pl b/src/lib/libcrypto/aes/asm/aes-x86_64.pl
11=================================================================== 46index 78ba20ca5..299214800 100755
12RCS file: /cvs/src/lib/libcrypto/x86_64cpuid.pl,v 47--- a/src/lib/libcrypto/aes/asm/aes-x86_64.pl
13diff -u -p -r1.15 x86_64cpuid.pl 48+++ b/src/lib/libcrypto/aes/asm/aes-x86_64.pl
14--- x86_64cpuid.pl 25 Apr 2023 04:42:25 -0000 1.15
15+++ x86_64cpuid.pl 3 Dec 2023 20:18:30 -0000
16@@ -18,7 +18,7 @@ print<<___;
17 .extern OPENSSL_cpuid_setup
18 .hidden OPENSSL_cpuid_setup
19 .section .init
20- endbr64
21+ _CET_ENDBR
22 call OPENSSL_cpuid_setup
23
24 .extern OPENSSL_ia32cap_P
25@@ -30,7 +30,7 @@ print<<___;
26 .type OPENSSL_ia32_cpuid,\@abi-omnipotent
27 .align 16
28 OPENSSL_ia32_cpuid:
29- endbr64
30+ _CET_ENDBR
31 mov %rbx,%r8 # save %rbx
32
33 xor %eax,%eax
34Index: aes/asm/aes-x86_64.pl
35===================================================================
36RCS file: /cvs/src/lib/libcrypto/aes/asm/aes-x86_64.pl,v
37diff -u -p -r1.12 aes-x86_64.pl
38--- aes/asm/aes-x86_64.pl 25 Apr 2023 04:42:25 -0000 1.12
39+++ aes/asm/aes-x86_64.pl 3 Dec 2023 20:18:30 -0000
40@@ -318,7 +318,7 @@ $code.=<<___; 49@@ -318,7 +318,7 @@ $code.=<<___;
41 .type _x86_64_AES_encrypt,\@abi-omnipotent 50 .type _x86_64_AES_encrypt,\@abi-omnipotent
42 .align 16 51 .align 16
@@ -154,12 +163,10 @@ diff -u -p -r1.12 aes-x86_64.pl
154 push %rsi 163 push %rsi
155 push %rdi 164 push %rdi
156 push %rbx 165 push %rbx
157Index: aes/asm/aesni-sha1-x86_64.pl 166diff --git a/src/lib/libcrypto/aes/asm/aesni-sha1-x86_64.pl b/src/lib/libcrypto/aes/asm/aesni-sha1-x86_64.pl
158=================================================================== 167index 879d16793..5eb5b7bf6 100644
159RCS file: /cvs/src/lib/libcrypto/aes/asm/aesni-sha1-x86_64.pl,v 168--- a/src/lib/libcrypto/aes/asm/aesni-sha1-x86_64.pl
160diff -u -p -r1.8 aesni-sha1-x86_64.pl 169+++ b/src/lib/libcrypto/aes/asm/aesni-sha1-x86_64.pl
161--- aes/asm/aesni-sha1-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.8
162+++ aes/asm/aesni-sha1-x86_64.pl 3 Dec 2023 20:18:30 -0000
163@@ -89,7 +89,7 @@ $code.=<<___; 170@@ -89,7 +89,7 @@ $code.=<<___;
164 .type aesni_cbc_sha1_enc,\@abi-omnipotent 171 .type aesni_cbc_sha1_enc,\@abi-omnipotent
165 .align 16 172 .align 16
@@ -196,12 +203,10 @@ diff -u -p -r1.8 aesni-sha1-x86_64.pl
196 push %rsi 203 push %rsi
197 push %rdi 204 push %rdi
198 push %rbx 205 push %rbx
199Index: aes/asm/aesni-x86_64.pl 206diff --git a/src/lib/libcrypto/aes/asm/aesni-x86_64.pl b/src/lib/libcrypto/aes/asm/aesni-x86_64.pl
200=================================================================== 207index 07d40a84a..43013a51f 100644
201RCS file: /cvs/src/lib/libcrypto/aes/asm/aesni-x86_64.pl,v 208--- a/src/lib/libcrypto/aes/asm/aesni-x86_64.pl
202diff -u -p -r1.12 aesni-x86_64.pl 209+++ b/src/lib/libcrypto/aes/asm/aesni-x86_64.pl
203--- aes/asm/aesni-x86_64.pl 18 Sep 2023 22:38:16 -0000 1.12
204+++ aes/asm/aesni-x86_64.pl 3 Dec 2023 20:18:30 -0000
205@@ -242,7 +242,7 @@ $code.=<<___; 210@@ -242,7 +242,7 @@ $code.=<<___;
206 .type ${PREFIX}_encrypt,\@abi-omnipotent 211 .type ${PREFIX}_encrypt,\@abi-omnipotent
207 .align 16 212 .align 16
@@ -346,12 +351,10 @@ diff -u -p -r1.12 aesni-x86_64.pl
346 push %rsi 351 push %rsi
347 push %rdi 352 push %rdi
348 push %rbx 353 push %rbx
349Index: aes/asm/bsaes-x86_64.pl 354diff --git a/src/lib/libcrypto/aes/asm/bsaes-x86_64.pl b/src/lib/libcrypto/aes/asm/bsaes-x86_64.pl
350=================================================================== 355index 7098ba27f..c44a33811 100644
351RCS file: /cvs/src/lib/libcrypto/aes/asm/bsaes-x86_64.pl,v 356--- a/src/lib/libcrypto/aes/asm/bsaes-x86_64.pl
352diff -u -p -r1.6 bsaes-x86_64.pl 357+++ b/src/lib/libcrypto/aes/asm/bsaes-x86_64.pl
353--- aes/asm/bsaes-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.6
354+++ aes/asm/bsaes-x86_64.pl 3 Dec 2023 20:18:30 -0000
355@@ -813,7 +813,7 @@ $code.=<<___; 358@@ -813,7 +813,7 @@ $code.=<<___;
356 .type _bsaes_encrypt8,\@abi-omnipotent 359 .type _bsaes_encrypt8,\@abi-omnipotent
357 .align 64 360 .align 64
@@ -478,12 +481,10 @@ diff -u -p -r1.6 bsaes-x86_64.pl
478 push %rsi 481 push %rsi
479 push %rdi 482 push %rdi
480 push %rbx 483 push %rbx
481Index: aes/asm/vpaes-x86_64.pl 484diff --git a/src/lib/libcrypto/aes/asm/vpaes-x86_64.pl b/src/lib/libcrypto/aes/asm/vpaes-x86_64.pl
482=================================================================== 485index 8ff8d8602..7d92e8d8c 100644
483RCS file: /cvs/src/lib/libcrypto/aes/asm/vpaes-x86_64.pl,v 486--- a/src/lib/libcrypto/aes/asm/vpaes-x86_64.pl
484diff -u -p -r1.5 vpaes-x86_64.pl 487+++ b/src/lib/libcrypto/aes/asm/vpaes-x86_64.pl
485--- aes/asm/vpaes-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.5
486+++ aes/asm/vpaes-x86_64.pl 3 Dec 2023 20:18:30 -0000
487@@ -82,7 +82,7 @@ $code.=<<___; 488@@ -82,7 +82,7 @@ $code.=<<___;
488 .type _vpaes_encrypt_core,\@abi-omnipotent 489 .type _vpaes_encrypt_core,\@abi-omnipotent
489 .align 16 490 .align 16
@@ -610,31 +611,10 @@ diff -u -p -r1.5 vpaes-x86_64.pl
610 push %rsi 611 push %rsi
611 push %rdi 612 push %rdi
612 push %rbx 613 push %rbx
613Index: bn/s2n_bignum_internal.h 614diff --git a/src/lib/libcrypto/bn/arch/amd64/bignum_add.S b/src/lib/libcrypto/bn/arch/amd64/bignum_add.S
614=================================================================== 615index 06298ca69..5fe4aae7a 100644
615RCS file: /cvs/src/lib/libcrypto/bn/s2n_bignum_internal.h,v 616--- a/src/lib/libcrypto/bn/arch/amd64/bignum_add.S
616diff -u -p -r1.2 s2n_bignum_internal.h 617+++ b/src/lib/libcrypto/bn/arch/amd64/bignum_add.S
617--- bn/s2n_bignum_internal.h 21 Jan 2023 15:53:54 -0000 1.2
618+++ bn/s2n_bignum_internal.h 3 Dec 2023 20:22:18 -0000
619@@ -18,6 +18,12 @@
620 # define S2N_BN_SYMBOL(name) name
621 #endif
622
623+#ifdef __CET__
624+# include <cet.h>
625+#else
626+# define _CET_ENDBR
627+#endif
628+
629 #define S2N_BN_SYM_VISIBILITY_DIRECTIVE(name) .globl S2N_BN_SYMBOL(name)
630 #ifdef S2N_BN_HIDE_SYMBOLS
631 # ifdef __APPLE__
632Index: bn/arch/amd64/bignum_add.S
633===================================================================
634RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_add.S,v
635diff -u -p -r1.4 bignum_add.S
636--- bn/arch/amd64/bignum_add.S 25 Apr 2023 04:42:26 -0000 1.4
637+++ bn/arch/amd64/bignum_add.S 3 Dec 2023 20:18:30 -0000
638@@ -49,7 +49,7 @@ 618@@ -49,7 +49,7 @@
639 619
640 620
@@ -644,12 +624,10 @@ diff -u -p -r1.4 bignum_add.S
644 624
645 #if WINDOWS_ABI 625 #if WINDOWS_ABI
646 push rdi 626 push rdi
647Index: bn/arch/amd64/bignum_cmadd.S 627diff --git a/src/lib/libcrypto/bn/arch/amd64/bignum_cmadd.S b/src/lib/libcrypto/bn/arch/amd64/bignum_cmadd.S
648=================================================================== 628index 5ad712749..25ba17bce 100644
649RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_cmadd.S,v 629--- a/src/lib/libcrypto/bn/arch/amd64/bignum_cmadd.S
650diff -u -p -r1.4 bignum_cmadd.S 630+++ b/src/lib/libcrypto/bn/arch/amd64/bignum_cmadd.S
651--- bn/arch/amd64/bignum_cmadd.S 25 Apr 2023 04:42:26 -0000 1.4
652+++ bn/arch/amd64/bignum_cmadd.S 3 Dec 2023 20:18:30 -0000
653@@ -54,7 +54,7 @@ 631@@ -54,7 +54,7 @@
654 632
655 633
@@ -659,12 +637,10 @@ diff -u -p -r1.4 bignum_cmadd.S
659 637
660 #if WINDOWS_ABI 638 #if WINDOWS_ABI
661 push rdi 639 push rdi
662Index: bn/arch/amd64/bignum_cmul.S 640diff --git a/src/lib/libcrypto/bn/arch/amd64/bignum_cmul.S b/src/lib/libcrypto/bn/arch/amd64/bignum_cmul.S
663=================================================================== 641index 9199c8f48..12f785d63 100644
664RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_cmul.S,v 642--- a/src/lib/libcrypto/bn/arch/amd64/bignum_cmul.S
665diff -u -p -r1.4 bignum_cmul.S 643+++ b/src/lib/libcrypto/bn/arch/amd64/bignum_cmul.S
666--- bn/arch/amd64/bignum_cmul.S 25 Apr 2023 04:42:26 -0000 1.4
667+++ bn/arch/amd64/bignum_cmul.S 3 Dec 2023 20:18:30 -0000
668@@ -51,7 +51,7 @@ 644@@ -51,7 +51,7 @@
669 645
670 646
@@ -674,12 +650,10 @@ diff -u -p -r1.4 bignum_cmul.S
674 650
675 #if WINDOWS_ABI 651 #if WINDOWS_ABI
676 push rdi 652 push rdi
677Index: bn/arch/amd64/bignum_mul.S 653diff --git a/src/lib/libcrypto/bn/arch/amd64/bignum_mul.S b/src/lib/libcrypto/bn/arch/amd64/bignum_mul.S
678=================================================================== 654index 2d7ed1909..a3552679a 100644
679RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_mul.S,v 655--- a/src/lib/libcrypto/bn/arch/amd64/bignum_mul.S
680diff -u -p -r1.4 bignum_mul.S 656+++ b/src/lib/libcrypto/bn/arch/amd64/bignum_mul.S
681--- bn/arch/amd64/bignum_mul.S 25 Apr 2023 04:42:26 -0000 1.4
682+++ bn/arch/amd64/bignum_mul.S 3 Dec 2023 20:18:30 -0000
683@@ -59,7 +59,7 @@ 657@@ -59,7 +59,7 @@
684 658
685 659
@@ -689,12 +663,10 @@ diff -u -p -r1.4 bignum_mul.S
689 663
690 #if WINDOWS_ABI 664 #if WINDOWS_ABI
691 push rdi 665 push rdi
692Index: bn/arch/amd64/bignum_mul_4_8_alt.S 666diff --git a/src/lib/libcrypto/bn/arch/amd64/bignum_mul_4_8_alt.S b/src/lib/libcrypto/bn/arch/amd64/bignum_mul_4_8_alt.S
693=================================================================== 667index f02b09b28..70ff69e37 100644
694RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_mul_4_8_alt.S,v 668--- a/src/lib/libcrypto/bn/arch/amd64/bignum_mul_4_8_alt.S
695diff -u -p -r1.4 bignum_mul_4_8_alt.S 669+++ b/src/lib/libcrypto/bn/arch/amd64/bignum_mul_4_8_alt.S
696--- bn/arch/amd64/bignum_mul_4_8_alt.S 25 Apr 2023 04:42:26 -0000 1.4
697+++ bn/arch/amd64/bignum_mul_4_8_alt.S 3 Dec 2023 20:18:30 -0000
698@@ -72,7 +72,7 @@ 670@@ -72,7 +72,7 @@
699 adc h, rdx 671 adc h, rdx
700 672
@@ -704,12 +676,10 @@ diff -u -p -r1.4 bignum_mul_4_8_alt.S
704 676
705 #if WINDOWS_ABI 677 #if WINDOWS_ABI
706 push rdi 678 push rdi
707Index: bn/arch/amd64/bignum_mul_8_16_alt.S 679diff --git a/src/lib/libcrypto/bn/arch/amd64/bignum_mul_8_16_alt.S b/src/lib/libcrypto/bn/arch/amd64/bignum_mul_8_16_alt.S
708=================================================================== 680index 97be83e1f..066403b07 100644
709RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_mul_8_16_alt.S,v 681--- a/src/lib/libcrypto/bn/arch/amd64/bignum_mul_8_16_alt.S
710diff -u -p -r1.4 bignum_mul_8_16_alt.S 682+++ b/src/lib/libcrypto/bn/arch/amd64/bignum_mul_8_16_alt.S
711--- bn/arch/amd64/bignum_mul_8_16_alt.S 25 Apr 2023 04:42:26 -0000 1.4
712+++ bn/arch/amd64/bignum_mul_8_16_alt.S 3 Dec 2023 20:18:30 -0000
713@@ -72,7 +72,7 @@ 683@@ -72,7 +72,7 @@
714 adc h, rdx 684 adc h, rdx
715 685
@@ -719,12 +689,10 @@ diff -u -p -r1.4 bignum_mul_8_16_alt.S
719 689
720 #if WINDOWS_ABI 690 #if WINDOWS_ABI
721 push rdi 691 push rdi
722Index: bn/arch/amd64/bignum_sqr.S 692diff --git a/src/lib/libcrypto/bn/arch/amd64/bignum_sqr.S b/src/lib/libcrypto/bn/arch/amd64/bignum_sqr.S
723=================================================================== 693index c4a0cabf3..54e3f5944 100644
724RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_sqr.S,v 694--- a/src/lib/libcrypto/bn/arch/amd64/bignum_sqr.S
725diff -u -p -r1.4 bignum_sqr.S 695+++ b/src/lib/libcrypto/bn/arch/amd64/bignum_sqr.S
726--- bn/arch/amd64/bignum_sqr.S 25 Apr 2023 04:42:26 -0000 1.4
727+++ bn/arch/amd64/bignum_sqr.S 3 Dec 2023 20:18:30 -0000
728@@ -62,7 +62,7 @@ 696@@ -62,7 +62,7 @@
729 #define llshort ebp 697 #define llshort ebp
730 698
@@ -734,12 +702,10 @@ diff -u -p -r1.4 bignum_sqr.S
734 702
735 #if WINDOWS_ABI 703 #if WINDOWS_ABI
736 push rdi 704 push rdi
737Index: bn/arch/amd64/bignum_sqr_4_8_alt.S 705diff --git a/src/lib/libcrypto/bn/arch/amd64/bignum_sqr_4_8_alt.S b/src/lib/libcrypto/bn/arch/amd64/bignum_sqr_4_8_alt.S
738=================================================================== 706index b228414dc..7c534ae90 100644
739RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_sqr_4_8_alt.S,v 707--- a/src/lib/libcrypto/bn/arch/amd64/bignum_sqr_4_8_alt.S
740diff -u -p -r1.4 bignum_sqr_4_8_alt.S 708+++ b/src/lib/libcrypto/bn/arch/amd64/bignum_sqr_4_8_alt.S
741--- bn/arch/amd64/bignum_sqr_4_8_alt.S 25 Apr 2023 04:42:26 -0000 1.4
742+++ bn/arch/amd64/bignum_sqr_4_8_alt.S 3 Dec 2023 20:18:30 -0000
743@@ -71,7 +71,7 @@ 709@@ -71,7 +71,7 @@
744 adc c, 0 710 adc c, 0
745 711
@@ -749,12 +715,10 @@ diff -u -p -r1.4 bignum_sqr_4_8_alt.S
749 715
750 #if WINDOWS_ABI 716 #if WINDOWS_ABI
751 push rdi 717 push rdi
752Index: bn/arch/amd64/bignum_sqr_8_16_alt.S 718diff --git a/src/lib/libcrypto/bn/arch/amd64/bignum_sqr_8_16_alt.S b/src/lib/libcrypto/bn/arch/amd64/bignum_sqr_8_16_alt.S
753=================================================================== 719index 04efeec7e..ac0b6f96c 100644
754RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_sqr_8_16_alt.S,v 720--- a/src/lib/libcrypto/bn/arch/amd64/bignum_sqr_8_16_alt.S
755diff -u -p -r1.4 bignum_sqr_8_16_alt.S 721+++ b/src/lib/libcrypto/bn/arch/amd64/bignum_sqr_8_16_alt.S
756--- bn/arch/amd64/bignum_sqr_8_16_alt.S 25 Apr 2023 04:42:26 -0000 1.4
757+++ bn/arch/amd64/bignum_sqr_8_16_alt.S 3 Dec 2023 20:18:30 -0000
758@@ -103,7 +103,7 @@ 722@@ -103,7 +103,7 @@
759 adc c, 0 723 adc c, 0
760 724
@@ -764,12 +728,10 @@ diff -u -p -r1.4 bignum_sqr_8_16_alt.S
764 728
765 #if WINDOWS_ABI 729 #if WINDOWS_ABI
766 push rdi 730 push rdi
767Index: bn/arch/amd64/bignum_sub.S 731diff --git a/src/lib/libcrypto/bn/arch/amd64/bignum_sub.S b/src/lib/libcrypto/bn/arch/amd64/bignum_sub.S
768=================================================================== 732index 11a9bd7ed..3ff8a3051 100644
769RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_sub.S,v 733--- a/src/lib/libcrypto/bn/arch/amd64/bignum_sub.S
770diff -u -p -r1.4 bignum_sub.S 734+++ b/src/lib/libcrypto/bn/arch/amd64/bignum_sub.S
771--- bn/arch/amd64/bignum_sub.S 25 Apr 2023 04:42:26 -0000 1.4
772+++ bn/arch/amd64/bignum_sub.S 3 Dec 2023 20:18:30 -0000
773@@ -49,7 +49,7 @@ 735@@ -49,7 +49,7 @@
774 736
775 737
@@ -779,12 +741,10 @@ diff -u -p -r1.4 bignum_sub.S
779 741
780 #if WINDOWS_ABI 742 #if WINDOWS_ABI
781 push rdi 743 push rdi
782Index: bn/arch/amd64/word_clz.S 744diff --git a/src/lib/libcrypto/bn/arch/amd64/word_clz.S b/src/lib/libcrypto/bn/arch/amd64/word_clz.S
783=================================================================== 745index 464a9d90f..3926fcd4b 100644
784RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/word_clz.S,v 746--- a/src/lib/libcrypto/bn/arch/amd64/word_clz.S
785diff -u -p -r1.4 word_clz.S 747+++ b/src/lib/libcrypto/bn/arch/amd64/word_clz.S
786--- bn/arch/amd64/word_clz.S 25 Apr 2023 04:42:26 -0000 1.4
787+++ bn/arch/amd64/word_clz.S 3 Dec 2023 20:18:30 -0000
788@@ -30,7 +30,7 @@ 748@@ -30,7 +30,7 @@
789 .text 749 .text
790 750
@@ -794,12 +754,10 @@ diff -u -p -r1.4 word_clz.S
794 754
795 #if WINDOWS_ABI 755 #if WINDOWS_ABI
796 push rdi 756 push rdi
797Index: bn/asm/modexp512-x86_64.pl 757diff --git a/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl b/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl
798=================================================================== 758index af78fff54..8645d5adc 100644
799RCS file: /cvs/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl,v 759--- a/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl
800diff -u -p -r1.4 modexp512-x86_64.pl 760+++ b/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl
801--- bn/asm/modexp512-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.4
802+++ bn/asm/modexp512-x86_64.pl 3 Dec 2023 20:18:30 -0000
803@@ -347,7 +347,7 @@ $code.=<<___; 761@@ -347,7 +347,7 @@ $code.=<<___;
804 .type MULADD_128x512,\@abi-omnipotent 762 .type MULADD_128x512,\@abi-omnipotent
805 .align 16 763 .align 16
@@ -845,12 +803,10 @@ diff -u -p -r1.4 modexp512-x86_64.pl
845 push %rbp 803 push %rbp
846 push %rbx 804 push %rbx
847 push %r12 805 push %r12
848Index: bn/asm/x86_64-mont.pl 806diff --git a/src/lib/libcrypto/bn/asm/x86_64-mont.pl b/src/lib/libcrypto/bn/asm/x86_64-mont.pl
849=================================================================== 807index 6f5ab331e..30cfab4fc 100755
850RCS file: /cvs/src/lib/libcrypto/bn/asm/x86_64-mont.pl,v 808--- a/src/lib/libcrypto/bn/asm/x86_64-mont.pl
851diff -u -p -r1.5 x86_64-mont.pl 809+++ b/src/lib/libcrypto/bn/asm/x86_64-mont.pl
852--- bn/asm/x86_64-mont.pl 25 Apr 2023 04:42:26 -0000 1.5
853+++ bn/asm/x86_64-mont.pl 3 Dec 2023 20:18:30 -0000
854@@ -63,7 +63,7 @@ $code=<<___; 810@@ -63,7 +63,7 @@ $code=<<___;
855 .type bn_mul_mont,\@function,6 811 .type bn_mul_mont,\@function,6
856 .align 16 812 .align 16
@@ -878,12 +834,10 @@ diff -u -p -r1.5 x86_64-mont.pl
878 push %rbx 834 push %rbx
879 push %rbp 835 push %rbp
880 push %r12 836 push %r12
881Index: bn/asm/x86_64-mont5.pl 837diff --git a/src/lib/libcrypto/bn/asm/x86_64-mont5.pl b/src/lib/libcrypto/bn/asm/x86_64-mont5.pl
882=================================================================== 838index 3b3325a6c..38751ec5d 100755
883RCS file: /cvs/src/lib/libcrypto/bn/asm/x86_64-mont5.pl,v 839--- a/src/lib/libcrypto/bn/asm/x86_64-mont5.pl
884diff -u -p -r1.8 x86_64-mont5.pl 840+++ b/src/lib/libcrypto/bn/asm/x86_64-mont5.pl
885--- bn/asm/x86_64-mont5.pl 25 Apr 2023 04:42:26 -0000 1.8
886+++ bn/asm/x86_64-mont5.pl 3 Dec 2023 20:18:30 -0000
887@@ -57,7 +57,7 @@ $code=<<___; 841@@ -57,7 +57,7 @@ $code=<<___;
888 .type bn_mul_mont_gather5,\@function,6 842 .type bn_mul_mont_gather5,\@function,6
889 .align 64 843 .align 64
@@ -929,12 +883,27 @@ diff -u -p -r1.8 x86_64-mont5.pl
929 push %rsi 883 push %rsi
930 push %rdi 884 push %rdi
931 push %rbx 885 push %rbx
932Index: camellia/asm/cmll-x86_64.pl 886diff --git a/src/lib/libcrypto/bn/s2n_bignum_internal.h b/src/lib/libcrypto/bn/s2n_bignum_internal.h
933=================================================================== 887index f41368833..b82db7d01 100644
934RCS file: /cvs/src/lib/libcrypto/camellia/asm/cmll-x86_64.pl,v 888--- a/src/lib/libcrypto/bn/s2n_bignum_internal.h
935diff -u -p -r1.7 cmll-x86_64.pl 889+++ b/src/lib/libcrypto/bn/s2n_bignum_internal.h
936--- camellia/asm/cmll-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.7 890@@ -18,6 +18,12 @@
937+++ camellia/asm/cmll-x86_64.pl 3 Dec 2023 20:18:30 -0000 891 # define S2N_BN_SYMBOL(name) name
892 #endif
893
894+#ifdef __CET__
895+# include <cet.h>
896+#else
897+# define _CET_ENDBR
898+#endif
899+
900 #define S2N_BN_SYM_VISIBILITY_DIRECTIVE(name) .globl S2N_BN_SYMBOL(name)
901 #ifdef S2N_BN_HIDE_SYMBOLS
902 # ifdef __APPLE__
903diff --git a/src/lib/libcrypto/camellia/asm/cmll-x86_64.pl b/src/lib/libcrypto/camellia/asm/cmll-x86_64.pl
904index 3ceed3e89..187f0596d 100644
905--- a/src/lib/libcrypto/camellia/asm/cmll-x86_64.pl
906+++ b/src/lib/libcrypto/camellia/asm/cmll-x86_64.pl
938@@ -116,7 +116,7 @@ $code=<<___; 907@@ -116,7 +116,7 @@ $code=<<___;
939 .type Camellia_EncryptBlock,\@abi-omnipotent 908 .type Camellia_EncryptBlock,\@abi-omnipotent
940 .align 16 909 .align 16
@@ -1007,12 +976,10 @@ diff -u -p -r1.7 cmll-x86_64.pl
1007 cmp \$0,%rdx 976 cmp \$0,%rdx
1008 je .Lcbc_abort 977 je .Lcbc_abort
1009 push %rbx 978 push %rbx
1010Index: md5/asm/md5-x86_64.pl 979diff --git a/src/lib/libcrypto/md5/asm/md5-x86_64.pl b/src/lib/libcrypto/md5/asm/md5-x86_64.pl
1011=================================================================== 980index 06d69094f..5001c3472 100755
1012RCS file: /cvs/src/lib/libcrypto/md5/asm/md5-x86_64.pl,v 981--- a/src/lib/libcrypto/md5/asm/md5-x86_64.pl
1013diff -u -p -r1.3 md5-x86_64.pl 982+++ b/src/lib/libcrypto/md5/asm/md5-x86_64.pl
1014--- md5/asm/md5-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.3
1015+++ md5/asm/md5-x86_64.pl 3 Dec 2023 20:18:30 -0000
1016@@ -128,7 +128,7 @@ $code .= <<EOF; 983@@ -128,7 +128,7 @@ $code .= <<EOF;
1017 .globl md5_block_asm_data_order 984 .globl md5_block_asm_data_order
1018 .type md5_block_asm_data_order,\@function,3 985 .type md5_block_asm_data_order,\@function,3
@@ -1022,12 +989,10 @@ diff -u -p -r1.3 md5-x86_64.pl
1022 push %rbp 989 push %rbp
1023 push %rbx 990 push %rbx
1024 push %r12 991 push %r12
1025Index: modes/asm/ghash-x86_64.pl 992diff --git a/src/lib/libcrypto/modes/asm/ghash-x86_64.pl b/src/lib/libcrypto/modes/asm/ghash-x86_64.pl
1026=================================================================== 993index 4fded507c..f3caac15d 100644
1027RCS file: /cvs/src/lib/libcrypto/modes/asm/ghash-x86_64.pl,v 994--- a/src/lib/libcrypto/modes/asm/ghash-x86_64.pl
1028diff -u -p -r1.5 ghash-x86_64.pl 995+++ b/src/lib/libcrypto/modes/asm/ghash-x86_64.pl
1029--- modes/asm/ghash-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.5
1030+++ modes/asm/ghash-x86_64.pl 3 Dec 2023 20:18:30 -0000
1031@@ -412,7 +412,7 @@ $code.=<<___; 996@@ -412,7 +412,7 @@ $code.=<<___;
1032 .type gcm_init_clmul,\@abi-omnipotent 997 .type gcm_init_clmul,\@abi-omnipotent
1033 .align 16 998 .align 16
@@ -1064,12 +1029,10 @@ diff -u -p -r1.5 ghash-x86_64.pl
1064 push %rsi 1029 push %rsi
1065 push %rdi 1030 push %rdi
1066 push %rbx 1031 push %rbx
1067Index: perlasm/x86_64-xlate.pl 1032diff --git a/src/lib/libcrypto/perlasm/x86_64-xlate.pl b/src/lib/libcrypto/perlasm/x86_64-xlate.pl
1068=================================================================== 1033index 5dbed2a8c..325e7cf58 100755
1069RCS file: /cvs/src/lib/libcrypto/perlasm/x86_64-xlate.pl,v 1034--- a/src/lib/libcrypto/perlasm/x86_64-xlate.pl
1070diff -u -p -r1.16 x86_64-xlate.pl 1035+++ b/src/lib/libcrypto/perlasm/x86_64-xlate.pl
1071--- perlasm/x86_64-xlate.pl 23 Feb 2023 08:49:02 -0000 1.16
1072+++ perlasm/x86_64-xlate.pl 3 Dec 2023 20:17:16 -0000
1073@@ -781,6 +781,22 @@ ___ 1036@@ -781,6 +781,22 @@ ___
1074 OPTION DOTNAME 1037 OPTION DOTNAME
1075 ___ 1038 ___
@@ -1093,12 +1056,10 @@ diff -u -p -r1.16 x86_64-xlate.pl
1093 print "#include \"x86_arch.h\"\n"; 1056 print "#include \"x86_arch.h\"\n";
1094 1057
1095 while($line=<>) { 1058 while($line=<>) {
1096Index: rc4/asm/rc4-md5-x86_64.pl 1059diff --git a/src/lib/libcrypto/rc4/asm/rc4-md5-x86_64.pl b/src/lib/libcrypto/rc4/asm/rc4-md5-x86_64.pl
1097=================================================================== 1060index 3190e6a8e..e5e8aa08a 100644
1098RCS file: /cvs/src/lib/libcrypto/rc4/asm/rc4-md5-x86_64.pl,v 1061--- a/src/lib/libcrypto/rc4/asm/rc4-md5-x86_64.pl
1099diff -u -p -r1.4 rc4-md5-x86_64.pl 1062+++ b/src/lib/libcrypto/rc4/asm/rc4-md5-x86_64.pl
1100--- rc4/asm/rc4-md5-x86_64.pl 28 Jul 2023 10:35:14 -0000 1.4
1101+++ rc4/asm/rc4-md5-x86_64.pl 3 Dec 2023 20:18:30 -0000
1102@@ -109,7 +109,7 @@ $code.=<<___; 1063@@ -109,7 +109,7 @@ $code.=<<___;
1103 .globl $func 1064 .globl $func
1104 .type $func,\@function,$nargs 1065 .type $func,\@function,$nargs
@@ -1117,12 +1078,10 @@ diff -u -p -r1.4 rc4-md5-x86_64.pl
1117 lea 8($dat),$dat 1078 lea 8($dat),$dat
1118 lea ($inp,$len),$inp 1079 lea ($inp,$len),$inp
1119 neg $len 1080 neg $len
1120Index: rc4/asm/rc4-x86_64.pl 1081diff --git a/src/lib/libcrypto/rc4/asm/rc4-x86_64.pl b/src/lib/libcrypto/rc4/asm/rc4-x86_64.pl
1121=================================================================== 1082index 0472acce8..a9cf9d1bd 100755
1122RCS file: /cvs/src/lib/libcrypto/rc4/asm/rc4-x86_64.pl,v 1083--- a/src/lib/libcrypto/rc4/asm/rc4-x86_64.pl
1123diff -u -p -r1.16 rc4-x86_64.pl 1084+++ b/src/lib/libcrypto/rc4/asm/rc4-x86_64.pl
1124--- rc4/asm/rc4-x86_64.pl 28 Jul 2023 10:35:14 -0000 1.16
1125+++ rc4/asm/rc4-x86_64.pl 3 Dec 2023 20:18:30 -0000
1126@@ -128,7 +128,7 @@ $code=<<___; 1085@@ -128,7 +128,7 @@ $code=<<___;
1127 .type RC4,\@function,4 1086 .type RC4,\@function,4
1128 .align 16 1087 .align 16
@@ -1141,12 +1100,10 @@ diff -u -p -r1.16 rc4-x86_64.pl
1141 lea 8($dat),$dat 1100 lea 8($dat),$dat
1142 lea ($inp,$len),$inp 1101 lea ($inp,$len),$inp
1143 neg $len 1102 neg $len
1144Index: sha/asm/sha1-x86_64.pl 1103diff --git a/src/lib/libcrypto/sha/asm/sha1-x86_64.pl b/src/lib/libcrypto/sha/asm/sha1-x86_64.pl
1145=================================================================== 1104index e15ff47f8..e080251df 100755
1146RCS file: /cvs/src/lib/libcrypto/sha/asm/sha1-x86_64.pl,v 1105--- a/src/lib/libcrypto/sha/asm/sha1-x86_64.pl
1147diff -u -p -r1.7 sha1-x86_64.pl 1106+++ b/src/lib/libcrypto/sha/asm/sha1-x86_64.pl
1148--- sha/asm/sha1-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.7
1149+++ sha/asm/sha1-x86_64.pl 3 Dec 2023 20:18:30 -0000
1150@@ -222,7 +222,7 @@ $code.=<<___; 1107@@ -222,7 +222,7 @@ $code.=<<___;
1151 .type sha1_block_data_order,\@function,3 1108 .type sha1_block_data_order,\@function,3
1152 .align 16 1109 .align 16
@@ -1183,12 +1140,10 @@ diff -u -p -r1.7 sha1-x86_64.pl
1183 push %rsi 1140 push %rsi
1184 push %rdi 1141 push %rdi
1185 push %rbx 1142 push %rbx
1186Index: sha/asm/sha512-x86_64.pl 1143diff --git a/src/lib/libcrypto/sha/asm/sha512-x86_64.pl b/src/lib/libcrypto/sha/asm/sha512-x86_64.pl
1187=================================================================== 1144index 120693fee..f7a4dad2c 100755
1188RCS file: /cvs/src/lib/libcrypto/sha/asm/sha512-x86_64.pl,v 1145--- a/src/lib/libcrypto/sha/asm/sha512-x86_64.pl
1189diff -u -p -r1.7 sha512-x86_64.pl 1146+++ b/src/lib/libcrypto/sha/asm/sha512-x86_64.pl
1190--- sha/asm/sha512-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.7
1191+++ sha/asm/sha512-x86_64.pl 3 Dec 2023 20:18:30 -0000
1192@@ -175,7 +175,7 @@ $code=<<___; 1147@@ -175,7 +175,7 @@ $code=<<___;
1193 .type $func,\@function,4 1148 .type $func,\@function,4
1194 .align 16 1149 .align 16
@@ -1198,12 +1153,10 @@ diff -u -p -r1.7 sha512-x86_64.pl
1198 push %rbx 1153 push %rbx
1199 push %rbp 1154 push %rbp
1200 push %r12 1155 push %r12
1201Index: whrlpool/asm/wp-x86_64.pl 1156diff --git a/src/lib/libcrypto/whrlpool/asm/wp-x86_64.pl b/src/lib/libcrypto/whrlpool/asm/wp-x86_64.pl
1202=================================================================== 1157index 7958f6d28..2a3902430 100644
1203RCS file: /cvs/src/lib/libcrypto/whrlpool/asm/wp-x86_64.pl,v 1158--- a/src/lib/libcrypto/whrlpool/asm/wp-x86_64.pl
1204diff -u -p -r1.5 wp-x86_64.pl 1159+++ b/src/lib/libcrypto/whrlpool/asm/wp-x86_64.pl
1205--- whrlpool/asm/wp-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.5
1206+++ whrlpool/asm/wp-x86_64.pl 3 Dec 2023 20:18:30 -0000
1207@@ -57,7 +57,7 @@ $code=<<___; 1160@@ -57,7 +57,7 @@ $code=<<___;
1208 .type $func,\@function,3 1161 .type $func,\@function,3
1209 .align 16 1162 .align 16
@@ -1213,3 +1166,28 @@ diff -u -p -r1.5 wp-x86_64.pl
1213 push %rbx 1166 push %rbx
1214 push %rbp 1167 push %rbp
1215 push %r12 1168 push %r12
1169diff --git a/src/lib/libcrypto/x86_64cpuid.pl b/src/lib/libcrypto/x86_64cpuid.pl
1170index dc56732a2..5e85c40c9 100644
1171--- a/src/lib/libcrypto/x86_64cpuid.pl
1172+++ b/src/lib/libcrypto/x86_64cpuid.pl
1173@@ -18,7 +18,7 @@ print<<___;
1174 .extern OPENSSL_cpuid_setup
1175 .hidden OPENSSL_cpuid_setup
1176 .section .init
1177- endbr64
1178+ _CET_ENDBR
1179 call OPENSSL_cpuid_setup
1180
1181 .extern OPENSSL_ia32cap_P
1182@@ -30,7 +30,7 @@ print<<___;
1183 .type OPENSSL_ia32_cpuid,\@abi-omnipotent
1184 .align 16
1185 OPENSSL_ia32_cpuid:
1186- endbr64
1187+ _CET_ENDBR
1188 mov %rbx,%r8 # save %rbx
1189
1190 xor %eax,%eax
1191--
11922.43.0
1193