]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix a lock in provider_remove_store_methods()
authorMatt Caswell <matt@openssl.org>
Mon, 24 Oct 2022 08:22:01 +0000 (09:22 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 25 Oct 2022 10:52:04 +0000 (11:52 +0100)
We were taking a read lock. It should have been a write lock.

Fixes #19474

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19481)

crypto/provider_core.c

index efddbf74f8330f0daa86fa428aba52e8313e3752..c05b2f5496e73feb46d472901eebdfd90cf5fac8 100644 (file)
@@ -1208,7 +1208,7 @@ static int provider_remove_store_methods(OSSL_PROVIDER *prov)
     if (!freeing) {
         int acc;
 
-        if (!CRYPTO_THREAD_read_lock(prov->opbits_lock))
+        if (!CRYPTO_THREAD_write_lock(prov->opbits_lock))
             return 0;
         OPENSSL_free(prov->operation_bits);
         prov->operation_bits = NULL;