armcap: skip probing _armv7_tick()
authorCameron Gutman <aicommander@gmail.com>
Sat, 23 Jul 2022 02:04:46 +0000 (21:04 -0500)
committerHugo Landau <hlandau@openssl.org>
Tue, 4 Oct 2022 10:56:47 +0000 (11:56 +0100)
Detection of this feature is unreliable so only use it if requested.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18852)

crypto/armcap.c

index 7e6cd8fe907515607236cbada48a1d559dfa094a..0aa11baed4b93585c25e17b5b6c6e21116579187 100644 (file)
@@ -357,11 +357,11 @@ void OPENSSL_cpuid_setup(void)
 #  endif
 # endif
 
-    /* Things that getauxval didn't tell us */
-    if (sigsetjmp(ill_jmp, 1) == 0) {
-        _armv7_tick();
-        OPENSSL_armcap_P |= ARMV7_TICK;
-    }
+    /*
+     * Probing for ARMV7_TICK is known to produce unreliable results,
+     * so we will only use the feature when the user explicitly enables
+     * it with OPENSSL_armcap.
+     */
 
     sigaction(SIGILL, &ill_oact, NULL);
     sigprocmask(SIG_SETMASK, &oset, NULL);