[openssl/openssl] 24d16d: Make rcu_thread_key context-aware

Neil Horman noreply at github.com
Fri Apr 19 13:49:06 UTC 2024


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 24d16d3a1915a06a2130385a87de9a37fc09c4b9
      https://github.com/openssl/openssl/commit/24d16d3a1915a06a2130385a87de9a37fc09c4b9
  Author: Neil Horman <nhorman at openssl.org>
  Date:   2024-04-19 (Fri, 19 Apr 2024)

  Changed paths:
    M crypto/conf/conf_mod.c
    M crypto/context.c
    M crypto/threads_none.c
    M crypto/threads_pthread.c
    M crypto/threads_win.c
    M doc/internal/man3/ossl_rcu_lock_new.pod
    M include/internal/cryptlib.h
    M include/internal/rcu.h
    M test/threadstest.c
    M test/threadstest.h

  Log Message:
  -----------
  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 at openssl.org>
Reviewed-by: Matt Caswell <matt at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24162)



To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications


More information about the openssl-commits mailing list