]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
x86asm: Generate endbr32 based on __CET__.
authorSebastian Andrzej Siewior <sebastian@breakpoint.cc>
Thu, 19 May 2022 19:51:18 +0000 (21:51 +0200)
committerPauli <pauli@openssl.org>
Tue, 24 May 2022 03:16:06 +0000 (13:16 +1000)
The VIA Nehemiah CPU is a x86-32 CPU without SSE2 support. It does not
support multi byte nops and considers the endb32 opcode as an invalid
instruction.

Add an ifdef around the endbr32 opcode on x86-32.

Fixes: #18334
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18353)

crypto/perlasm/x86asm.pl

index be462cec6eefa1b6df1a8b8007803318ef27aad3..2ec16c5571d867f1cf02bc9c44d4b589103c4196 100644 (file)
@@ -174,7 +174,9 @@ sub ::vprotd
 
 sub ::endbranch
 {
+    &::generic("#ifdef __CET__\n");
     &::data_byte(0xf3,0x0f,0x1e,0xfb);
+    &::generic("#endif\n");
 }
 
 # label management