Fix data race setting `default_DSO_meth`
authorPauli <pauli@openssl.org>
Fri, 5 Nov 2021 03:10:10 +0000 (13:10 +1000)
committerPauli <pauli@openssl.org>
Sun, 7 Nov 2021 22:58:38 +0000 (08:58 +1000)
commite6a10b074e90f1ce3d8e9ae0ca740a835ff29bb9
tree7b86d450ddc671783ac35f038462fc17bbc96669
parent1b4d9967a24154f1dc00f471eb843203ec7bb7d4
Fix data race setting `default_DSO_meth`

The global variable `default_DSO_meth` was potentially set multiple times by
different threads.  It turns out that it could only be set to a single value
so the race is harmless but still better avoided.  The fix here simply removes
the global and accesses the value it was set to via the `DSO_METHOD_openssl()`
call.

Problem discovered via #16970, but this does not resolve that issue because
there are other concerns.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16972)
crypto/dso/dso_lib.c