Skip to content

Commit

Permalink
Fix a lock in provider_remove_store_methods()
Browse files Browse the repository at this point in the history
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 #19481)

(cherry picked from commit 6962e21)
  • Loading branch information
mattcaswell committed Oct 25, 2022
1 parent b0ef844 commit 02be04e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/provider_core.c
Expand Up @@ -1204,7 +1204,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;
Expand Down

0 comments on commit 02be04e

Please sign in to comment.