openssl: fips.so is not self-contained
When we build fips.so we do so with the “-z defs” linker option (on Linux):
This is supposed to ensure that all symbols are resolved. Without this the link completes successfully even though some symbols are not defined in the resulting .so file. If that happens then I think those symbols get resolved from libcrypto at load time…which obviously would means that fips.so is not self-contained.
This used to work just fine. But it no longer seems to be the case. For example the symbol _bignum_modp_1536_p is defined here:
Since this is guarded with ifndef FIPS_MODE the symbol only exists in libcrypto and not in fips.so. The symbol is referenced from bn_const.c here:
This code does get included in fips.so and the reference to _bignum_modp_1536_p is not guarded with FIPS_MODE guards like it should be. This should have resulted in a link failure - but it hasn’t.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 50 (50 by maintainers)
Commits related to this issue
- Configuration: Add post module building check We want an extra check that the FIPS provider module has resolved all symbols except the standard library ones. This is generalized with the addition of... — committed to levitte/openssl by levitte 4 years ago
- TEST: Add a simple module loader, and test the FIPS module with it This very simple module loader is only linked with the standard C library, so cannot and should not provide any other symbol to the ... — committed to levitte/openssl by levitte 4 years ago
- TEST: Add a simple module loader, and test the FIPS module with it This very simple module loader is only linked with the standard C library, so cannot and should not provide any other symbol to the ... — committed to openssl/openssl by levitte 4 years ago
@levitte Passing -Wl,–allow-shlib-undefined when linking the libfips.so should allow you to have undefined symbol from libcrypto without linking it.
I’m not sure how it’s not. The problem was unresolved libcrypto symbols in the FIPS module, right? If loaded without libcrypto present (and with
RTLD_NOW), the load should fail, shouldn’t it?