]> git.ipfire.org Git - thirdparty/openssl.git/commit
"Reserve" the method store when constructing methods
authorRichard Levitte <levitte@openssl.org>
Thu, 14 Apr 2022 15:52:12 +0000 (17:52 +0200)
committerHugo Landau <hlandau@openssl.org>
Wed, 20 Jul 2022 06:28:17 +0000 (07:28 +0100)
commite1eafe8c87612a94552e9ad5df56c489cb6f0ff2
tree1f5bc3b2087f9280313f3b59a43509a897d62508
parentd768f853bb05b5a49a2aeb5b5702776834e68d06
"Reserve" the method store when constructing methods

Introducing the concept of reserving the store where a number of
provided operation methods are to be stored.

This avoids racing when constructing provided methods, which is
especially pertinent when multiple threads are trying to fetch the
same method, or even any implementation for the same given operation
type.

This introduces a |biglock| in OSSL_METHOD_STORE, which is separate
from the |lock| which is used for more internal and finer grained
locking.

Fixes #18152

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18153)
crypto/core_algorithm.c
crypto/core_fetch.c
crypto/encode_decode/decoder_meth.c
crypto/encode_decode/encoder_meth.c
crypto/evp/evp_fetch.c
crypto/property/property.c
crypto/store/store_meth.c
include/internal/core.h
include/internal/property.h