]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix failure checking on rcu_read_lock
authorNeil Horman <nhorman@openssl.org>
Thu, 7 Aug 2025 13:50:58 +0000 (09:50 -0400)
committerNeil Horman <nhorman@openssl.org>
Sat, 9 Aug 2025 13:22:13 +0000 (09:22 -0400)
commit036a46d2a4b00a004d05dc6a6d19be7184f8ecf1
treeacaa4149686e835118eedfe73b7e48718a656f5a
parent7f780be21608a2982cdf1c567e5afeb724b1e9a1
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)
crypto/conf/conf_mod.c
crypto/hashtable/hashtable.c
crypto/threads_none.c
crypto/threads_pthread.c
crypto/threads_win.c
fuzz/hashtable.c
include/internal/hashtable.h
include/internal/rcu.h
test/lhash_test.c
test/threadstest.c