From 078abceb29077f9204db3dfca16de646e94c9014 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Mon, 16 Mar 2015 13:00:53 -0700 Subject: [PATCH] Don't install SIGILL handler until after sigsetjmp. Previously, if SIGILL was received between the signal handler being installed and before the sigsetjmp, the process would longjmp to a random location. Change-Id: I9e6143a17ff3db0e1b00ece68fce161801461010 Reviewed-on: https://boringssl-review.googlesource.com/3950 Reviewed-by: David Benjamin Reviewed-by: Adam Langley --- crypto/cpu-arm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/cpu-arm.c b/crypto/cpu-arm.c index 8ca60fbf..ba619390 100644 --- a/crypto/cpu-arm.c +++ b/crypto/cpu-arm.c @@ -93,10 +93,10 @@ static int probe_for_NEON() { sigset_t original_sigmask; sigprocmask(SIG_SETMASK, &sigmask, &original_sigmask); - sigaction(SIGILL, &sigill_action, &sigill_original_action); - if (sigsetjmp(sigill_jmp, 1 /* save signals */) == 0) { + sigaction(SIGILL, &sigill_action, &sigill_original_action); + // This function cannot be inline asm because GCC will refuse to compile // inline NEON instructions unless building with -mfpu=neon, which would // defeat the point of probing for support at runtime.