Commit da82481942 for openssl.org
commit da82481942bbad11a179b4a02296f92c7abfef36
Author: Gleb Popov <6yearold@gmail.com>
Date: Thu Aug 28 13:28:07 2025 +0300
async_posix.c: Fix calling to makecontext() on Elbrus2000
makecontext() allocates memory on e2k, thus it may fail in OOM conditions.
To underline this fact, the function was renamed to have a suffix.
Reviewed-by: Andrew Dinh <andrewd@openssl.org>
Reviewed-by: Igor Ustinov <igus@openssl.foundation>
MergeDate: Fri Jul 31 16:49:19 2026
(Merged from https://github.com/openssl/openssl/pull/31269)
diff --git a/crypto/async/arch/async_posix.c b/crypto/async/arch/async_posix.c
index 46e2ce7559..3838fc6d01 100644
--- a/crypto/async/arch/async_posix.c
+++ b/crypto/async/arch/async_posix.c
@@ -116,7 +116,11 @@ int async_fibre_makecontext(async_fibre *fibre)
if (fibre->fibre.uc_stack.ss_sp != NULL) {
fibre->fibre.uc_stack.ss_size = num;
fibre->fibre.uc_link = NULL;
+#ifndef __e2k__
makecontext(&fibre->fibre, async_start_func, 0);
+#else
+ makecontext_e2k(&fibre->fibre, async_start_func, 0);
+#endif
return 1;
}
} else {
@@ -129,6 +133,9 @@ void async_fibre_free(async_fibre *fibre)
{
stack_free_impl(fibre->fibre.uc_stack.ss_sp);
fibre->fibre.uc_stack.ss_sp = NULL;
+#ifdef __e2k__
+ freecontext_e2k(&fibre->fibre);
+#endif
}
#endif