Support for -fvisibility=hidden in openssl 3.0

Helde, Paavo Paavo.Helde at PERKINELMER.COM
Thu Nov 10 14:44:52 UTC 2022


We have a Linux application which can load a lot of different .so modules at runtime, which in turn might be contain various third-party libraries. In the past we have seen the problems that there might appear different binarily incompatible openssl versions in the process memory, which might get mixed up and cause crashes or worse. The worst offender was libpython which can install and load its own modules on fly, with totally uncontrollable openssl versions in them.

We attempted to fight with this by compiling static openssl libraries with -fvisibility=hidden and linking our own .so-s against it. This ought to hide the symbols from Python at least. It looks like this actually worked with openssl-1.1.

Alas, now we are switching over to openssl-3.0 (the fresh 3.0.7) and it looks like this approach does not work anymore. We are getting initialization errors, I think from OSSL_PROVIDER_load("legacy") or such.

s2n_init() failed: 402653268 (Failed to load or unload an openssl provider)
Fatal error condition occurred in /srv/paavo/DataAnalysis/Acapella/trunk/Production/Intermediates/ThirdParty/src/aws-sdk-cpp/crt/aws-crt-cpp/crt/aws-c-io/source/s2n/s2n_tls_channel_handler.c:197: 0 && "s2n_init() failed"
Exiting Application
No call stack information available
Aborted (core dumped)

Removing the -fvisibility=hidden flag from openssl compilation gets rid of this problem, but I'm afraid this may cause conflicts with python again.

So my question is should this usage work, and if so, how to get it working?

TIA
Paavo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mta.openssl.org/pipermail/openssl-users/attachments/20221110/b0e0d67e/attachment.htm>


More information about the openssl-users mailing list