If the child provider context data gets cleaned up before all usage of
providers has finished then a use-after-free can occur. We change the
priority of this data so that it gets freed later.
Fixes #15284
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15286)
}
static const OSSL_LIB_CTX_METHOD child_prov_ossl_ctx_method = {
- OSSL_LIB_CTX_METHOD_DEFAULT_PRIORITY,
+ OSSL_LIB_CTX_METHOD_LOW_PRIORITY,
child_prov_ossl_ctx_new,
child_prov_ossl_ctx_free,
};
# define OSSL_LIB_CTX_CHILD_PROVIDER_INDEX 18
# define OSSL_LIB_CTX_MAX_INDEXES 19
+# define OSSL_LIB_CTX_METHOD_LOW_PRIORITY -1
# define OSSL_LIB_CTX_METHOD_DEFAULT_PRIORITY 0
# define OSSL_LIB_CTX_METHOD_PRIORITY_1 1
# define OSSL_LIB_CTX_METHOD_PRIORITY_2 2