boringssl/crypto/fipsmodule
David Benjamin 17ce286e07 Work around an apparent Linux or glibc bug on ppc64le in FIPS mode.
POWER8 has hardware transactional memory, which glibc uses to implement
locks. In some cases, taking a lock begins a transaction, wrapping
arbitrary user code (!) until the lock is released. If the transaction
is aborted, everything rewinds and glibc tries again with some other
implementation.

The kernel will abort the transaction in a variety of cases. Notably, on
a syscall, the transaction aborts and the syscall *does not happen*.
https://www.kernel.org/doc/Documentation/powerpc/transactional_memory.txt

Yet, for some reason, although the relevant change does appear to be in
the kernel, the transaction is being rewound with getrandom happening
anyway. This does not work very well.

Instead, only guard the DRBG access with the lock, not CRYPTO_sysrand.
This lock is only used to protect the DRBG from the destructor that
zeros everything.

Change-Id: Ied8350f1e808a09300651de4200c7b0d07b3a158
Reviewed-on: https://boringssl-review.googlesource.com/16985
Commit-Queue: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2017-06-07 19:59:24 +00:00
..
aes Change ppc64le AES code for FIPS. 2017-05-25 22:02:22 +00:00
bn Convert bn_test to GTest. 2017-06-05 21:45:07 +00:00
cipher Revert "Fix platforms that don't define UINT64_MAX." 2017-06-07 02:15:27 +00:00
des Move des/ to crypto/fipsmodule/ 2017-05-02 19:21:02 +00:00
digest Be less clever about .rel.ro avoidance. 2017-04-07 15:20:26 +00:00
ec p256-x86_64-asm.pl: minor sqr_montx cleanup. 2017-06-05 18:37:55 +00:00
ecdsa Convert ECDSA tests to GTest. 2017-06-07 19:22:23 +00:00
hmac
md4
md5 Remove filename argument to x86 asm_init. 2017-05-12 14:58:27 +00:00
modes Move AES-GCM-SIV out from SMALL and handle unaligned keys. 2017-06-01 18:45:06 +00:00
rand Work around an apparent Linux or glibc bug on ppc64le in FIPS mode. 2017-06-07 19:59:24 +00:00
rsa Remove ex_data's dup hook. 2017-05-23 22:43:59 +00:00
sha Remove filename argument to x86 asm_init. 2017-05-12 14:58:27 +00:00
bcm.c Clarify the error message for an ECDSA power-on test failure. 2017-06-01 00:05:55 +00:00
CMakeLists.txt Convert ECDSA tests to GTest. 2017-06-07 19:22:23 +00:00
delocate.h Switch to new delocate tool. 2017-05-30 18:00:16 +00:00
FIPS.md Inject FIPS hash without running module. 2017-04-12 23:09:38 +00:00
intcheck1.png
intcheck2.png Inject FIPS hash without running module. 2017-04-12 23:09:38 +00:00
intcheck3.png
is_fips.c Move OPENSSL_ASAN to base.h. 2017-05-16 20:16:52 +00:00