]> git.ipfire.org Git - thirdparty/openssl.git/commit
Allow for reuse of thread_local keys in threads_none
authorNeil Horman <nhorman@openssl.org>
Thu, 5 Jun 2025 12:25:52 +0000 (08:25 -0400)
committerNeil Horman <nhorman@openssl.org>
Fri, 6 Jun 2025 18:12:45 +0000 (14:12 -0400)
commitacadfec4cf83db616914b3fd88dcc402cdfbc18a
tree5d4a738547c45c2e6295cdb96c7d55c1957f8a38
parent67a1497100488dc58c2d591a604615053e4cc565
Allow for reuse of thread_local keys in threads_none

If openssl is configured with no-threads, the implementation has a hard
limit of 256 LIB_CTX values, as each LIB_CTX allocates a thread local
key, and we never reuse them (like libc does when using
pthread_key_create/destroy.

Improve the situation by allowing for marking freed keys as unsued and
searching for an available key when allocating

Fixes #27757

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27775)

(cherry picked from commit b6d01d1b1fef2e98a956b7ba4e8443cf7d916dcb)
crypto/threads_none.c