<div dir="ltr"><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div>Hi folks,<br><br>Not sure if this is intended behaviour or not...<br><br>The use of Intel Control-flow Enforcement Technology (CET) in OpenSSL 3.0.2 is giving me issues on a VIA C3 Nehemiah based system. Turns out that while the VIA C3 Nehemiah is a i686 class x86 processor, it does not implement all the nop opcodes added in the Pentium Pro. So I get 'Illegal instruction' when trying to run OpenSSL programs due to the presence of the endbr32 instructions:<br><br>$ LD_LIBRARY_PATH=`pwd` apps/openssl version<br>Illegal instruction<br><br>Testing with the endbr32 generation in crypto/perlasm/<a href="http://x86asm.pl">x86asm.pl</a> commented out generates a working binary:</div><div><br></div><div>$ LD_LIBRARY_PATH=`pwd` apps/openssl version -a<br>OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)<br>built on: Sat Apr 30 10:20:30 2022 UTC<br>platform: linux-x86<br>options:  bn(64,32)<br>compiler: gcc -fPIC -pthread -m32 -Wa,--noexecstack -Wall -O3 -fomit-frame-pointer -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_BUILDING_OPENSSL -DNDEBUG<br>OPENSSLDIR: "/usr/local/ssl"<br>ENGINESDIR: "/usr/local/lib/engines-3"<br>MODULESDIR: "/usr/local/lib/ossl-modules"<br>Seeding source: os-specific<br>CPUINFO: OPENSSL_ia32cap=0x381bf3f:0x0<br></div><div><br></div><div>From a bit of experimentation it appears that the endbr32 instruction is always included in the generated x86 32-bit assembler code, even when using the 386 assembler option.</div><div><br></div><div>So, not sure if OpenSSL is dropping support for older 32-bit x86 processors, and the documentation hasn't caught up, or if this is just an oversight?</div><div><br></div><div>FWIW the gcc folks have limited generation of endbr32 instructions to at least i686 (cmov) and SSE2 (see <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98667" target="_blank">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98667</a>), to limit the use of the endbr32 instruction to target systems where it is handled as a nop.</div><div><div dir="ltr"><br></div></div><div>All the best,</div><div><br></div><div>Hamish</div><div class="gmail-yj6qo"></div><div class="gmail-adL"><br></div></div></div>