summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorNeil Horman <nhorman@openssl.org>2024-04-15 16:56:29 -0400
committerNeil Horman <nhorman@openssl.org>2024-04-19 09:22:53 -0400
commit24d16d3a1915a06a2130385a87de9a37fc09c4b9 (patch)
tree2add2328ebad114d63abcc440f0cbf3325eda44b /doc
parentfaa4a10ebe5095765262c0e3c711fca08026c3d4 (diff)
Make rcu_thread_key context-aware
Currently, rcu has a global bit of data, the CRYPTO_THREAD_LOCAL object to store per thread data. This works in some cases, but fails in FIPS, becuase it contains its own copy of the global key. So 1) Make the rcu_thr_key a per-context variable, and force ossl_rcu_lock_new to be context aware 2) Store a pointer to the context in the lock object 3) Use the context to get the global thread key on read/write lock 4) Use ossl_thread_start_init to properly register a cleanup on thread exit 5) Fix up missed calls to OSSL_thread_stop() in our tests Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/24162)
Diffstat (limited to 'doc')
-rw-r--r--doc/internal/man3/ossl_rcu_lock_new.pod5
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/internal/man3/ossl_rcu_lock_new.pod b/doc/internal/man3/ossl_rcu_lock_new.pod
index 7b82f6bbd0..57b5e4d73d 100644
--- a/doc/internal/man3/ossl_rcu_lock_new.pod
+++ b/doc/internal/man3/ossl_rcu_lock_new.pod
@@ -13,7 +13,7 @@ ossl_rcu_assign_uptr
=head1 SYNOPSIS
- CRYPTO_RCU_LOCK *ossl_rcu_lock_new(int num_writers);
+ CRYPTO_RCU_LOCK *ossl_rcu_lock_new(int num_writers, OSSL_LIB_CTX *ctx);
void ossl_rcu_read_lock(CRYPTO_RCU_LOCK *lock);
void ossl_rcu_write_lock(CRYPTO_RCU_LOCK *lock);
void ossl_rcu_write_unlock(CRYPTO_RCU_LOCK *lock);
@@ -65,7 +65,8 @@ ossl_rcu_lock_new() allocates a new RCU lock. The I<num_writers> param
indicates the number of write side threads which may execute
ossl_synchronize_rcu() in parallel. The value must be at least 1, but may be
larger to obtain increased write side throughput at the cost of additional
-internal memory usage. A value of 1 is generally recommended.
+internal memory usage. A value of 1 is generally recommended. The I<ctx>
+parameter references the library context in which the lock is allocated.
=item *