openssl/include/internal
Čestmír Kalina 4e43bc06f7 crypto: thread: serialize concurrent joins
Multiple concurrent joins with a running thread suffer from a race
condition that allows concurrent join calls to perform concurrent arch
specific join calls, which is UB on POSIX, or to concurrently execute
join and terminate calls.

As soon as a thread T1 exists, one of the threads that joins with T1
is selected to perform the join, the remaining ones await completion.
Once completed, the remaining calls immediately return. If the join
failed, another thread is selected to attempt the join operation.

Forcefully terminating a thread that is in the process of joining
another thread is not supported.

Common code from thread_posix and thread_win was refactored to use
common wrapper that handles synchronization.

Signed-off-by: Čestmír Kalina <ckalina@redhat.com>

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19433)
2022-10-21 12:44:56 +02:00
..
__DECC_INCLUDE_EPILOGUE.H
__DECC_INCLUDE_PROLOGUE.H
asn1.h internal/asn1.h: Add missing '#include <openssl/bio.h>' 2022-09-30 22:25:45 +02:00
bio_addr.h QUIC Demuxer and Record Layer (RX Side) 2022-09-02 10:03:55 +02:00
bio_tfo.h Add TFO support to socket BIO and s_client/s_server 2022-03-10 10:42:43 -05:00
bio.h BIO_sendmmsg/BIO_recvmmsg (API only) 2022-08-19 09:01:30 +01:00
common.h Add support for loading root CAs from Windows crypto API 2022-09-14 14:10:18 +01:00
comp.h Add ZSTD compression support (RFC8478bis) 2022-10-18 09:30:21 -04:00
conf.h
constant_time.h
core.h "Reserve" the method store when constructing methods 2022-07-20 07:28:17 +01:00
cryptlib.h crypto: add preemptive threading support 2022-10-17 09:45:39 +01:00
dane.h
deprecated.h
der.h der_writer: Use uint32_t instead of long. 2022-06-27 10:58:40 +02:00
dso.h
dsoerr.h
e_os.h Rename ossl_sleep() to OSSL_sleep() and make it public 2022-10-06 08:01:09 +02:00
endian.h
err.h
event_queue.h ssl: implement an event queue 2022-07-06 10:33:11 +10:00
ffc.h Use as small dh key size as possible to support the security 2022-07-18 08:06:17 +01:00
ktls.h Update copyright year 2022-05-03 13:34:51 +01:00
list.h list: add a doubly linked list type. 2022-09-05 16:24:53 +10:00
namemap.h Drop ossl_namemap_add_name_n() and simplify ossl_namemap_add_names() 2022-05-21 21:49:54 +02:00
nelem.h
numbers.h Fix definition of ossl_intmax_t and ossl_uintmax_t 2021-06-22 19:49:52 +10:00
o_dir.h
packet.h QUIC Frame Encoding and Decoding Functions 2022-07-29 16:28:37 +10:00
param_build_set.h Update copyright year 2022-05-03 13:34:51 +01:00
passphrase.h Fix pvk encoder to properly query for the passphrase 2021-12-06 16:38:03 +01:00
priority_queue.h Add additional include 2022-07-06 10:33:11 +10:00
property.h "Reserve" the method store when constructing methods 2022-07-20 07:28:17 +01:00
propertyerr.h
provider.h Drop ossl_provider_clear_all_operation_bits() and all uses of it 2022-05-05 15:05:54 +02:00
quic_ackm.h QUIC ACK Manager, Statistics Manager and Congestion Control API 2022-08-24 14:05:46 +01:00
quic_cc.h QUIC ACK Manager, Statistics Manager and Congestion Control API 2022-08-24 14:05:46 +01:00
quic_demux.h Add deferred datagram limit to QUIC Record Layer RX 2022-09-22 10:01:35 +01:00
quic_error.h QUIC Flow Control 2022-09-26 08:01:55 +01:00
quic_fc.h QUIC Flow Control 2022-09-26 08:01:55 +01:00
quic_record_rx.h Add deferred datagram limit to QUIC Record Layer RX 2022-09-22 10:01:35 +01:00
quic_record_tx.h TX key update support, RX time and PN reporting, general refactoring 2022-09-02 10:03:55 +02:00
quic_record_util.h QUIC Record Layer (Refactor and TX Side) 2022-09-02 10:03:55 +02:00
quic_rx_depack.h Implement the RX Depacketizer 2022-09-23 17:55:03 +02:00
quic_ssl.h Move the QUIC_CONNECTION typedef to internal headers 2022-09-23 17:48:54 +02:00
quic_statm.h QUIC ACK Manager, Statistics Manager and Congestion Control API 2022-08-24 14:05:46 +01:00
quic_stream.h QUIC Send Stream Management 2022-10-05 16:15:06 +02:00
quic_types.h TX key update support, RX time and PN reporting, general refactoring 2022-09-02 10:03:55 +02:00
quic_vlint.h QUIC wire format support 2022-05-27 08:00:52 +02:00
quic_wire_pkt.h TX key update support, RX time and PN reporting, general refactoring 2022-09-02 10:03:55 +02:00
quic_wire.h QUIC Demuxer and Record Layer (RX Side) 2022-09-02 10:03:55 +02:00
refcount.h Rework and make DEBUG macros consistent. 2021-05-28 10:04:31 +02:00
safe_math.h Avoid divide by 0 exception 2022-10-02 20:41:34 +11:00
sha3.h
sizes.h
sm3.h
sockets.h djgpp: Define WATT32_NO_OLDIES before including socket headers 2022-09-29 12:00:30 +02:00
sslconf.h
symhacks.h Instantiate predefined providers just-in-time 2021-06-24 14:48:14 +01:00
thread_arch.h crypto: thread: serialize concurrent joins 2022-10-21 12:44:56 +02:00
thread_once.h
thread.h crypto: add preemptive threading support 2022-10-17 09:45:39 +01:00
time.h time: add some additional utilities and document everything 2022-09-13 21:13:22 +10:00
tlsgroups.h Enable brainpool curves for TLS1.3 2021-11-26 06:45:19 +01:00
tsan_assist.h Update copyright year 2022-05-03 13:34:51 +01:00
uint_set.h QUIC Send Stream Management 2022-10-05 16:15:06 +02:00
unicode.h