[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Rich Salz rsalz at openssl.org
Sun Nov 13 20:44:14 UTC 2016


The branch OpenSSL_1_1_0-stable has been updated
       via  edc18749bd5dfb7e12513d3978f78f9b56104fd6 (commit)
      from  e2cefab06a9e1b8d9a21d030754f62dfbb199950 (commit)


- Log -----------------------------------------------------------------
commit edc18749bd5dfb7e12513d3978f78f9b56104fd6
Author: DK <dmitrykos at neutroncode.com>
Date:   Sun Nov 13 14:48:15 2016 +0200

    Fixed deadlock in CRYPTO_THREAD_run_once for Windows
    
    Fixed deadlock in CRYPTO_THREAD_run_once() if call to init() is causing
    a recursive call to CRYPTO_THREAD_run_once() again that is causing a hot
    deadloop inside do { } while (result == ONCE_ININIT); section.
    
    CLA: trivial
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/1913)
    
    (cherry picked from commit 349d1cfddcfa33d352240582a3803f2eba39d9a0)

-----------------------------------------------------------------------

Summary of changes:
 crypto/threads_win.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/threads_win.c b/crypto/threads_win.c
index 4e0de90..5347c9e 100644
--- a/crypto/threads_win.c
+++ b/crypto/threads_win.c
@@ -78,8 +78,8 @@ int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
     do {
         result = InterlockedCompareExchange(lock, ONCE_ININIT, ONCE_UNINITED);
         if (result == ONCE_UNINITED) {
-            init();
             *lock = ONCE_DONE;
+            init();
             return 1;
         }
     } while (result == ONCE_ININIT);


More information about the openssl-commits mailing list