]> git.ipfire.org Git - thirdparty/openssl.git/commit
Don't hold a lock when calling a callback in ossl_namemap_doall_names
authorMatt Caswell <matt@openssl.org>
Fri, 19 Feb 2021 17:03:43 +0000 (17:03 +0000)
committerPauli <ppzgs1@gmail.com>
Wed, 24 Feb 2021 22:37:22 +0000 (08:37 +1000)
commitd84f5515faf3fe00ed5eeca7e7b8b041be863e90
treeb2e8245e0a152f16b5bb2c5260e47781a6261c9d
parent6be27456e1346121b1fed797e92353733b59e16e
Don't hold a lock when calling a callback in ossl_namemap_doall_names

We don't want to hold a read lock when calling a user supplied callback.
That callback could do anything so the risk of a deadlock is high.
Instead we collect all the names first inside the read lock, and then
subsequently call the user callback outside the read lock.

Fixes #14225

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14250)
42 files changed:
apps/list.c
crypto/core_namemap.c
crypto/encode_decode/decoder_meth.c
crypto/encode_decode/decoder_pkey.c
crypto/encode_decode/encoder_meth.c
crypto/evp/asymcipher.c
crypto/evp/digest.c
crypto/evp/evp_enc.c
crypto/evp/evp_fetch.c
crypto/evp/evp_lib.c
crypto/evp/evp_local.h
crypto/evp/evp_rand.c
crypto/evp/exchange.c
crypto/evp/kdf_lib.c
crypto/evp/kem.c
crypto/evp/keymgmt_meth.c
crypto/evp/mac_lib.c
crypto/evp/names.c
crypto/evp/p_lib.c
crypto/evp/signature.c
crypto/store/store_meth.c
doc/internal/man3/ossl_namemap_new.pod
doc/man3/EVP_ASYM_CIPHER_free.pod
doc/man3/EVP_DigestInit.pod
doc/man3/EVP_EncryptInit.pod
doc/man3/EVP_KDF.pod
doc/man3/EVP_KEM_free.pod
doc/man3/EVP_KEYEXCH_free.pod
doc/man3/EVP_KEYMGMT.pod
doc/man3/EVP_MAC.pod
doc/man3/EVP_PKEY_is_a.pod
doc/man3/EVP_RAND.pod
doc/man3/EVP_SIGNATURE_free.pod
doc/man3/OSSL_DECODER.pod
doc/man3/OSSL_ENCODER.pod
doc/man3/OSSL_STORE_LOADER.pod
include/internal/namemap.h
include/openssl/decoder.h
include/openssl/encoder.h
include/openssl/evp.h
include/openssl/kdf.h
include/openssl/store.h