aboutsummaryrefslogtreecommitdiff
path: root/crypto/async/arch
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <sebastian@breakpoint.cc>2021-12-28 23:05:32 +0100
committerTomas Mraz <tomas@openssl.org>2022-01-04 12:15:09 +0100
commitd65b3db98022257cbf83d7d164bc0a8a9b92c101 (patch)
tree2458f3384c3b4a70c32396b5866d07e96cad1e1e /crypto/async/arch
parent8e5ba8d0be7410fb784d5895d97dcc23d6266715 (diff)
downloadopenssl-d65b3db98022257cbf83d7d164bc0a8a9b92c101.zip
openssl-d65b3db98022257cbf83d7d164bc0a8a9b92c101.tar.gz
openssl-d65b3db98022257cbf83d7d164bc0a8a9b92c101.tar.bz2
Use USE_SWAPCONTEXT on IA64.
On IA64 the use of setjmp()/ longjmp() does not properly save the state of the register stack engine (RSE) and requires extra care. The use of it in the async interface led to a failure in the test_async.t test since its introduction in 1.1.0 series. Instead of properly adding the needed assembly bits here use the swapcontext() function which properly saves the whole context. Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17370) (cherry picked from commit d26b3766a0a35668ee62b839a62acbdcd9ff2a98)
Diffstat (limited to 'crypto/async/arch')
-rw-r--r--crypto/async/arch/async_posix.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/async/arch/async_posix.h b/crypto/async/arch/async_posix.h
index ab7637f..eeb7774 100644
--- a/crypto/async/arch/async_posix.h
+++ b/crypto/async/arch/async_posix.h
@@ -25,12 +25,14 @@
# define ASYNC_POSIX
# define ASYNC_ARCH
-# ifdef __CET__
+# if defined(__CET__) || defined(__ia64__)
/*
* When Intel CET is enabled, makecontext will create a different
* shadow stack for each context. async_fibre_swapcontext cannot
* use _longjmp. It must call swapcontext to swap shadow stack as
* well as normal stack.
+ * On IA64 the register stack engine is not saved across setjmp/longjmp. Here
+ * swapcontext() performs correctly.
*/
# define USE_SWAPCONTEXT
# endif