openssl/crypto
Neil Horman 036a46d2a4 Fix failure checking on rcu_read_lock
during memfail testing:
https://github.com/openssl/openssl/actions/runs/16794088536/job/47561223902

We get lots of test failures in ossl_rcu_read_lock.  This occurs
because we have a few cases in the read lock path that attempt mallocs,
which, if they fail, trigger an assert or a silent failure, which isn't
really appropriate.  We should instead fail gracefully, by informing the
caller that the lock failed, like we do for CRYPTO_THREAD_read_lock.

Fortunately, these are all internal apis, so we can convert
ossl_rcu_read_lock to return an int indicating success/failure, and fail
gracefully during the test, rather than hitting an assert abort.

Fixes openssl/project#1315

Reviewed-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28195)
2025-08-09 09:22:13 -04:00
..
aes [RISC-V] Further optimization for AES-128-CBC decryption performance 2025-08-07 14:37:00 -04:00
aria
asn1 Deprecate ASN1_METH internal usage 2025-07-17 11:25:18 -04:00
async libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
bf
bio libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
bn crypto/bn: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
buffer
camellia Update dead links and e-mails our sources 2025-03-26 15:40:02 +01:00
cast
chacha Fix test failures on big endian ARMv9 target 2025-04-14 15:43:58 +01:00
cmac libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
cmp libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
cms crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
comp crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
conf Fix failure checking on rcu_read_lock 2025-08-09 09:22:13 -04:00
crmf libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
ct libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
des libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
dh Revert "Pairwise check for DH keys import as part of FIPS" 2025-07-31 20:39:40 +02:00
dsa libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
dso libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
ec crypto/ec: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
encode_decode crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
engine libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
err error: add new repeated parameter error 2025-08-08 10:33:14 +10:00
ess Copyright year updates 2024-09-05 09:35:49 +02:00
evp Only report generic error if provider did not put an error on the error queue 2025-07-30 18:27:08 +02:00
ffc libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
hashtable Fix failure checking on rcu_read_lock 2025-08-09 09:22:13 -04:00
hmac crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
hpke libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
http libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
idea Copyright year updates 2024-09-05 09:35:49 +02:00
kdf
lhash crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
lms LMS code review fixups 2025-07-10 19:04:37 +10:00
md2
md4
md5 Update dead links and e-mails our sources 2025-03-26 15:40:02 +01:00
mdc2
ml_dsa crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
ml_kem Address coverity issue 1655294 2025-07-09 15:20:55 -04:00
modes crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
objects crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
ocsp Copyright year updates 2025-03-12 13:35:59 +00:00
pem crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
perlasm Fix perl warnings on various scripts 2025-07-23 08:59:53 -04:00
pkcs7 libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
pkcs12 libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
poly1305 Update dead links and e-mails our sources 2025-03-26 15:40:02 +01:00
property libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
rand Fix failure checking on thread_local storage assignment in rand_lib 2025-08-09 09:22:13 -04:00
rc2
rc4 Update dead links and e-mails our sources 2025-03-26 15:40:02 +01:00
rc5
ripemd
rsa crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
seed
sha LoongArch: Add SHA-512 assembly implementation for better performance on small-size data 2025-07-24 12:02:49 +10:00
siphash libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
slh_dsa crypto/slh_dsa/slh_hash.c: Add check for EVP_MD_get_size() 2025-07-07 16:20:31 +02:00
sm2 crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
sm3 RISC-V: Provide optimized SM3 implementation using Zbb extension 2025-07-07 15:39:17 +02:00
sm4 Fix test failures on big endian ARMv9 target 2025-04-14 15:43:58 +01:00
srp crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
stack crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
store Fix OSSL_STORE to consider cached info in the EOF check. 2025-07-26 11:33:56 +02:00
thread libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
ts libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
txt_db crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
ui libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
whrlpool Update dead links and e-mails our sources 2025-03-26 15:40:02 +01:00
x509 crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
LPdir_nyi.c
LPdir_unix.c
LPdir_vms.c
LPdir_win.c libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
LPdir_win32.c
LPdir_wince.c
README-sparse_array.md
alphacpuid.pl Remove unused assembly function OPENSSL_wipe_cpu 2025-04-16 08:24:19 +10:00
arm64cpuid.pl
arm_arch.h Enable AES and SHA3 optimisations on Qualcomm Snapdragon X systems 2025-05-07 11:17:48 +10:00
armcap.c Enable AES and SHA3 optimisations on Qualcomm Snapdragon X systems 2025-05-07 11:17:48 +10:00
armv4cpuid.pl Remove unused assembly function OPENSSL_wipe_cpu 2025-04-16 08:24:19 +10:00
array_alloc.c Add array memory allocation routines 2025-08-08 12:22:10 -04:00
asn1_dsa.c
bsearch.c
build.info Add array memory allocation routines 2025-08-08 12:22:10 -04:00
c64xpluscpuid.pl Remove unused assembly function OPENSSL_wipe_cpu 2025-04-16 08:24:19 +10:00
comp_methods.c Move stack of compression methods from libssl to OSSL_LIB_CTX 2024-05-28 08:56:13 +02:00
context.c Restore use of crypto_thread_default_context 2025-06-20 13:01:39 -04:00
core_algorithm.c
core_fetch.c Copyright year updates 2025-03-12 13:35:59 +00:00
core_namemap.c Deprecate ASN1_METH internal usage 2025-07-17 11:25:18 -04:00
cpt_err.c Use the new hashtable for core_namemap 2024-08-21 15:21:26 +02:00
cpuid.c Extension of OPENSSL_ia32cap to accommodate additional CPUID bits 2024-12-13 14:51:22 +01:00
cryptlib.c libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
ctype.c
cversion.c crypto: fix preprocessor concatenation 2025-03-31 13:58:06 +02:00
defaults.c Fix probing the registry for configuration 2025-03-31 13:58:06 +02:00
der_writer.c
deterministic_nonce.c libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
dllmain.c Make cpuid_setup non-constructor 2025-04-29 14:19:51 +02:00
ebcdic.c
ex_data.c crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
getenv.c
ia64cpuid.S Remove unused assembly function OPENSSL_wipe_cpu 2025-04-16 08:24:19 +10:00
indicator_core.c Add FIPS indicator callback. 2024-07-11 08:29:43 +10:00
info.c Extension of OPENSSL_ia32cap to accommodate additional CPUID bits 2024-12-13 14:51:22 +01:00
init.c crypto/init.c optimize ossl_(un)likely 2025-07-16 13:07:15 -04:00
initthread.c Clean up thread_local function names in initthread.c 2025-06-20 13:01:39 -04:00
loongarch64cpuid.pl Copyright year updates 2025-03-12 13:35:59 +00:00
loongarch_arch.h
loongarchcap.c Eliminate indentation tabs from *.c and *.h files 2025-08-06 08:17:05 +10:00
mem.c crypto/mem.c: check for overflow in size calculation in CRYPTO_aligned_alloc 2025-08-08 12:22:10 -04:00
mem_clr.c
mem_sec.c crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
mips_arch.h
o_dir.c
o_fopen.c libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
o_init.c
o_str.c libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
o_time.c
packet.c libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
param_build.c libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
param_build_set.c
params.c kdf: remove max argument to the param concatenation helper 2025-07-31 20:20:48 +02:00
params_dup.c crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
params_from_text.c libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
pariscid.pl Remove unused assembly function OPENSSL_wipe_cpu 2025-04-16 08:24:19 +10:00
passphrase.c libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
ppccap.c Make cpuid_setup non-constructor 2025-04-29 14:19:51 +02:00
ppccpuid.pl Remove unused assembly function OPENSSL_wipe_cpu 2025-04-16 08:24:19 +10:00
provider.c Copyright year updates 2025-03-12 13:35:59 +00:00
provider_child.c
provider_conf.c crypto/provider_conf.c: Fix possible memory leak 2025-05-07 11:49:06 +02:00
provider_core.c crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
provider_local.h
provider_predefined.c
punycode.c libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
quic_vlint.c libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
rcu_internal.h
riscv32cpuid.pl Copyright year updates 2024-09-05 09:35:49 +02:00
riscv64cpuid.pl
riscvcap.c Make cpuid_setup non-constructor 2025-04-29 14:19:51 +02:00
s390x_arch.h s390x: Don't probe crypto cards for ME/CRT offloading during initialization 2024-10-23 15:07:01 +02:00
s390xcap.c s390x: Add new machine generation z17 2025-04-23 11:24:41 +02:00
s390xcpuid.pl Make cpuid_setup non-constructor 2025-04-29 14:19:51 +02:00
self_test_core.c Copyright year updates 2024-09-05 09:35:49 +02:00
sleep.c For Unix, refactor OSSL_sleep() to use nanosleep() instead of usleep() 2024-05-22 09:59:32 +02:00
sparccpuid.S Make cpuid_setup non-constructor 2025-04-29 14:19:51 +02:00
sparcv9cap.c
sparse_array.c crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
ssl_err.c Move ssl_err.c into libcrypto 2025-03-01 14:46:03 -05:00
sslerr.h Move ssl_err.c into libcrypto 2025-03-01 14:46:03 -05:00
threads_common.c crypto: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
threads_lib.c
threads_none.c Fix failure checking on rcu_read_lock 2025-08-09 09:22:13 -04:00
threads_pthread.c Fix failure checking on rcu_read_lock 2025-08-09 09:22:13 -04:00
threads_win.c Fix failure checking on rcu_read_lock 2025-08-09 09:22:13 -04:00
time.c crypto: fix missing <winsock.h> indirection inclusion. 2024-09-05 17:02:51 +02:00
trace.c libapps + libcrypto: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
uid.c
vms_rms.h
x86_64cpuid.pl Make cpuid_setup non-constructor 2025-04-29 14:19:51 +02:00
x86cpuid.pl Make cpuid_setup non-constructor 2025-04-29 14:19:51 +02:00