curl/lib
Aki a2bcec0ee0
openssl: fix the data race when sharing an SSL session between threads
The SSL_Session object is mutated during connection inside openssl,
and it might not be thread-safe. Besides, according to documentation
of openssl:

```
SSL_SESSION objects keep internal link information about the session
cache list, when being inserted into one SSL_CTX object's session
cache. One SSL_SESSION object, regardless of its reference count,
must therefore only be used with one SSL_CTX object (and the SSL
objects created from this SSL_CTX object).
```
If I understand correctly, it is not safe to share it even in a
single thread.

Instead, serialize the SSL_SESSION before adding it to the cache,
and deserialize it after retrieving it from the cache, so that no
concurrent write to the same object is infeasible.

Also
 - add a ci test for thread sanitizer
 - add a test for sharing ssl sessions concurrently
 - avoid redefining memory functions when not building libcurl, but
   including the soruce in libtest
 - increase the concurrent connections limit in sws

Notice that there are fix for a global data race for openssl which
is not yet release. The fix is cherry pick for the ci test with
thread sanitizer.
d8def79838

Closes #14751
2024-09-02 23:35:44 +02:00
..
vauth tests: delete libhostname.so and chkhostname 2024-08-27 23:40:48 +02:00
vquic openssl quic: fix memory leak 2024-08-29 16:48:49 +02:00
vssh ssh: deduplicate SSH backend includes (and fix libssh cmake unity build) 2024-08-20 21:34:24 +02:00
vtls openssl: fix the data race when sharing an SSL session between threads 2024-09-02 23:35:44 +02:00
.checksrc
.gitattributes
.gitignore build: remove MacOSX-Framework script 2024-04-08 22:46:51 +02:00
altsvc.c llist: remove direct struct accesses, use only functions 2024-08-12 13:18:10 +02:00
altsvc.h llist: remove direct struct accesses, use only functions 2024-08-12 13:18:10 +02:00
amigaos.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
amigaos.h
arpa_telnet.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
asyn-ares.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
asyn-thread.c tidy-up: misc spelling (bit, ASCII) 2024-08-15 15:30:09 +02:00
asyn.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
base64.c lib: silence -Wsign-conversion in base64, strcase, mprintf 2024-04-24 23:29:30 +02:00
bufq.c websocket: introduce blocking sends 2024-08-12 19:19:28 +02:00
bufq.h websocket: introduce blocking sends 2024-08-12 19:19:28 +02:00
bufref.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
bufref.h
c-hyper.c hyper: call Curl_req_set_upload_done() 2024-08-14 11:34:05 +02:00
c-hyper.h http: expect 100 rework 2024-03-18 12:41:56 +01:00
cf-h1-proxy.c lib: add eos flag to send methods 2024-08-03 19:53:54 +02:00
cf-h1-proxy.h
cf-h2-proxy.c http2: fix GOAWAY message sent to server 2024-08-21 03:36:50 -04:00
cf-h2-proxy.h
cf-haproxy.c haproxy: send though next filter 2024-09-02 23:34:26 +02:00
cf-haproxy.h
cf-https-connect.c connect: limit update IP info 2024-08-28 13:58:10 +02:00
cf-https-connect.h
cf-socket.c connect: limit update IP info 2024-08-28 13:58:10 +02:00
cf-socket.h setopt: allow CURLOPT_INTERFACE to be set to NULL 2024-08-21 14:33:51 +02:00
cfilters.c connect: limit update IP info 2024-08-28 13:58:10 +02:00
cfilters.h connect: limit update IP info 2024-08-28 13:58:10 +02:00
CMakeLists.txt cmake: minor tidy-ups 2024-08-26 11:00:08 +02:00
config-amigaos.h
config-dos.h
config-mac.h tidy-up: OS names 2024-08-04 19:17:45 +02:00
config-os400.h lib: remove use of RANDOM_FILE 2024-09-02 18:42:32 +02:00
config-plan9.h lib: remove use of RANDOM_FILE 2024-09-02 18:42:32 +02:00
config-riscos.h lib: remove use of RANDOM_FILE 2024-09-02 18:42:32 +02:00
config-win32.h build: prefer USE_IPV6 macro internally (was: ENABLE_IPV6) 2024-04-13 08:33:26 +00:00
config-win32ce.h tidy-up: OS names 2024-08-04 19:17:45 +02:00
conncache.c cpool: rename "connection cache/conncache" to "Connection Pools/cpool" 2024-08-28 13:52:49 +02:00
conncache.h cpool: rename "connection cache/conncache" to "Connection Pools/cpool" 2024-08-28 13:52:49 +02:00
connect.c connect: limit update IP info 2024-08-28 13:58:10 +02:00
connect.h connect: limit update IP info 2024-08-28 13:58:10 +02:00
content_encoding.c tidy-up: misc spelling (bit, ASCII) 2024-08-15 15:30:09 +02:00
content_encoding.h
cookie.c cookie: add more debug tracing to set-cookie handling 2024-08-28 13:59:33 +02:00
cookie.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_addrinfo.c tidy-up: OS names 2024-08-04 19:17:45 +02:00
curl_addrinfo.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_base64.h
curl_config.h.cmake lib: remove use of RANDOM_FILE 2024-09-02 18:42:32 +02:00
curl_ctype.h
curl_des.c lib: fix building with wolfSSL without DES support 2024-08-13 09:28:27 +02:00
curl_des.h lib: fix building with wolfSSL without DES support 2024-08-13 09:28:27 +02:00
curl_endian.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_endian.h
curl_fnmatch.c lib: tidy up types and casts 2024-06-05 14:02:39 +02:00
curl_fnmatch.h tidy-up: OS names 2024-08-04 19:17:45 +02:00
curl_get_line.c
curl_get_line.h
curl_gethostname.c tests: delete libhostname.so and chkhostname 2024-08-27 23:40:48 +02:00
curl_gethostname.h
curl_gssapi.c
curl_gssapi.h
curl_hmac.h
curl_krb5.h
curl_ldap.h
curl_md4.h
curl_md5.h
curl_memory.h
curl_memrchr.c
curl_memrchr.h
curl_multibyte.c curl_multibyte: remove access() function wrapper for Windows 2024-05-07 02:28:10 -04:00
curl_multibyte.h tidy-up: OS names 2024-08-04 19:17:45 +02:00
curl_ntlm_core.c lib: fix building with wolfSSL without DES support 2024-08-13 09:28:27 +02:00
curl_ntlm_core.h cmake: fix building unit1600 due to missing ssl/openssl.h 2024-07-13 12:00:14 +02:00
curl_path.c curl_path: make Curl_get_pathname use dynbuf 2024-05-08 10:10:12 +02:00
curl_path.h curl_path: make Curl_get_pathname use dynbuf 2024-05-08 10:10:12 +02:00
curl_printf.h printf: fix mingw-w64 format checks 2024-09-02 21:03:01 +02:00
curl_range.c
curl_range.h
curl_rtmp.c lib: add eos flag to send methods 2024-08-03 19:53:54 +02:00
curl_rtmp.h curl_version_info: provide librtmp version 2024-04-15 16:48:34 +02:00
curl_sasl.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_sasl.h
curl_setup_once.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_setup.h printf: fix mingw-w64 format checks 2024-09-02 21:03:01 +02:00
curl_sha256.h lib: prefer CURL_SHA256_DIGEST_LENGTH over the unprefixed name 2024-08-13 10:04:06 +02:00
curl_sha512_256.c tidy-up: spelling quiche and Rustls 2024-08-20 00:44:10 +02:00
curl_sha512_256.h curl_sha512_256: fix symbol collisions with nettle library 2024-08-13 10:04:06 +02:00
curl_sspi.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_sspi.h
curl_threads.c openssl: fix the data race when sharing an SSL session between threads 2024-09-02 23:35:44 +02:00
curl_threads.h windows: fix UWP builds, add GHA job 2024-06-05 00:52:24 +02:00
curl_trc.c smtp: add tracing feature 2024-08-14 11:51:55 +02:00
curl_trc.h smtp: add tracing feature 2024-08-14 11:51:55 +02:00
curlx.h src: replace copy of printf mappings with an include 2024-08-23 00:11:24 +02:00
cw-out.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
cw-out.h cw-out: improved error handling 2024-04-16 15:52:10 +02:00
dict.c lib: add eos flag to send methods 2024-08-03 19:53:54 +02:00
dict.h
dllmain.c dllmain: Call OpenSSL thread cleanup for Windows and Cygwin 2024-04-24 04:04:25 -04:00
doh.c urldata: introduce data->mid, a unique identifier inside a multi 2024-08-14 11:21:34 +02:00
doh.h urldata: introduce data->mid, a unique identifier inside a multi 2024-08-14 11:21:34 +02:00
dynbuf.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
dynbuf.h
dynhds.c build: untangle UNITTESTS and DEBUGBUILD macros 2024-05-27 21:15:50 +02:00
dynhds.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
easy_lock.h
easy.c cpool: rename "connection cache/conncache" to "Connection Pools/cpool" 2024-08-28 13:52:49 +02:00
easygetopt.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
easyif.h build: untangle CURLDEBUG and DEBUGBUILD macros 2024-05-28 08:12:00 +02:00
easyoptions.c tcpkeepalive: add CURLOPT_TCP_KEEPCNT and --keepalive-cnt 2024-06-12 09:31:17 +02:00
easyoptions.h
escape.c escape: allow curl_easy_escape to generate 3*input length output 2024-08-01 23:03:21 +02:00
escape.h
file.c tidy-up: OS names 2024-08-04 19:17:45 +02:00
file.h
fileinfo.c
fileinfo.h llist: remove direct struct accesses, use only functions 2024-08-12 13:18:10 +02:00
fopen.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
fopen.h
formdata.c GHA/configure-vs-cmake: add Windows build, fix issues 2024-08-26 11:07:58 +02:00
formdata.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
ftp.c ftp: always offer line end conversions 2024-08-29 20:24:37 +02:00
ftp.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
ftplistparser.c llist: add Curl_llist_append() 2024-04-11 09:00:51 +02:00
ftplistparser.h
functypes.h
getenv.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
getinfo.c connect: limit update IP info 2024-08-28 13:58:10 +02:00
getinfo.h
gopher.c lib: add eos flag to send methods 2024-08-03 19:53:54 +02:00
gopher.h
hash.c hash: provide asserts to verify API use 2024-08-15 08:54:19 +02:00
hash.h hash: provide asserts to verify API use 2024-08-15 08:54:19 +02:00
headers.c llist: remove direct struct accesses, use only functions 2024-08-12 13:18:10 +02:00
headers.h llist: remove direct struct accesses, use only functions 2024-08-12 13:18:10 +02:00
hmac.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
hostasyn.c url: dns_entry related improvements 2024-08-03 19:51:02 +02:00
hostip4.c tidy-up: OS names 2024-08-04 19:17:45 +02:00
hostip6.c tidy-up: OS names 2024-08-04 19:17:45 +02:00
hostip.c cpool: rename "connection cache/conncache" to "Connection Pools/cpool" 2024-08-28 13:52:49 +02:00
hostip.h tidy-up: OS names 2024-08-04 19:17:45 +02:00
hostsyn.c
hsts.c llist: remove direct struct accesses, use only functions 2024-08-12 13:18:10 +02:00
hsts.h llist: remove direct struct accesses, use only functions 2024-08-12 13:18:10 +02:00
http1.c lib: tidy up types and casts 2024-06-05 14:02:39 +02:00
http1.h
http2.c url: fix connection reuse for HTTP/2 upgrades 2024-09-02 12:39:03 +02:00
http2.h
http_aws_sigv4.c lib, src: delete stray curl_ prefix from printf calls 2024-08-26 11:00:15 +02:00
http_aws_sigv4.h
http_chunks.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http_chunks.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http_digest.c
http_digest.h
http_negotiate.c spnego_gssapi: implement TLS channel bindings for openssl 2024-08-12 19:16:54 +02:00
http_negotiate.h
http_ntlm.c tidy-up: OS names 2024-08-04 19:17:45 +02:00
http_ntlm.h tidy-up: OS names 2024-08-04 19:17:45 +02:00
http_proxy.c connection: shutdown TLS (for FTP) better 2024-06-10 13:08:12 +02:00
http_proxy.h
http.c url: fix connection reuse for HTTP/2 upgrades 2024-09-02 12:39:03 +02:00
http.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
idn.c configure: fix WinIDN builds targeting old Windows 2024-08-27 23:40:48 +02:00
idn.h idn: add native AppleIDN (icucore) support for macOS/iOS 2024-04-17 00:24:09 +02:00
if2ip.c lib: fix AIX build issues 2024-08-09 10:45:40 +02:00
if2ip.h if2ip: make the buf_size arg a size_t 2024-04-30 14:22:11 +02:00
imap.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
imap.h
inet_ntop.c tidy-up: OS names 2024-08-04 19:17:45 +02:00
inet_ntop.h lib: tidy up types and casts 2024-06-05 14:02:39 +02:00
inet_pton.c tidy-up: OS names 2024-08-04 19:17:45 +02:00
inet_pton.h
krb5.c krb5: fix -Wcast-align 2024-08-07 15:13:07 +02:00
ldap.c tidy-up: OS names 2024-08-04 19:17:45 +02:00
libcurl.rc (lib)curl.rc: set debug flag also for CURLDEBUG and UNITTESTS 2024-05-22 08:38:12 +02:00
libcurl.vers.in
llist.c llist: clear the list pointer when a node is removed 2024-08-30 13:17:42 +02:00
llist.h cpool: rename "connection cache/conncache" to "Connection Pools/cpool" 2024-08-28 13:52:49 +02:00
macos.c tidy-up: misc build, tests, lib/macos.c 2024-08-16 16:05:36 +02:00
macos.h
Makefile.am build: tidy up internal macro names for libcurl.pc 2024-08-12 14:56:41 +02:00
Makefile.inc mbedTLS: implement CURLOPT_SSL_CIPHER_LIST option 2024-04-24 14:30:37 +02:00
Makefile.mk tidy-up: misc build, tests, lib/macos.c 2024-08-16 16:05:36 +02:00
Makefile.soname
md4.c md4: fix compilation with OpenSSL 1.x with md4 disabled 2024-07-19 18:27:30 +02:00
md5.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
memdebug.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
memdebug.h lib: fix AIX build issues 2024-08-09 10:45:40 +02:00
mime.c lib, src: delete stray curl_ prefix from printf calls 2024-08-26 11:00:15 +02:00
mime.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
mprintf.c printf: fix mingw-w64 format checks 2024-09-02 21:03:01 +02:00
mqtt.c lib: add eos flag to send methods 2024-08-03 19:53:54 +02:00
mqtt.h
multi.c urldata: remove proxy_connect_closed bit 2024-08-28 14:00:42 +02:00
multihandle.h cpool: rename "connection cache/conncache" to "Connection Pools/cpool" 2024-08-28 13:52:49 +02:00
multiif.h cpool: rename "connection cache/conncache" to "Connection Pools/cpool" 2024-08-28 13:52:49 +02:00
netrc.c lib, src: delete stray curl_ prefix from printf calls 2024-08-26 11:00:15 +02:00
netrc.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
nonblock.c tidy-up: OS names 2024-08-04 19:17:45 +02:00
nonblock.h
noproxy.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
noproxy.h noproxy: patterns need to be comma separated 2024-06-01 12:25:13 +02:00
openldap.c lib: add eos flag to send methods 2024-08-03 19:53:54 +02:00
optiontable.pl curl.h: make CURLOPT_WRITEINFO and CURLOPT_CLOSEPOLICY compile 2024-09-02 10:43:34 +02:00
parsedate.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
parsedate.h
pingpong.c pingpong: drain the input buffer when reading responses 2024-08-19 23:31:38 +02:00
pingpong.h ftp: flush pingpong before response 2024-08-08 17:52:25 +02:00
pop3.c POP3: fix multi-line responses 2024-08-30 15:38:25 +02:00
pop3.h pop3: use the protocol handler ->write_resp 2024-08-26 14:59:50 +02:00
progress.c getinfo: add CURLINFO_POSTTRANSFER_TIME_T 2024-08-15 09:02:58 +02:00
progress.h progress: ratelimit/progress tweaks 2024-08-02 11:17:44 +02:00
psl.c
psl.h
rand.c rand: only provide weak random when needed 2024-09-02 18:42:32 +02:00
rand.h rand: only provide weak random when needed 2024-09-02 18:42:32 +02:00
rename.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
rename.h
request.c getinfo: add CURLINFO_POSTTRANSFER_TIME_T 2024-08-15 09:02:58 +02:00
request.h transfer: skip EOS read when download done 2024-08-28 13:54:38 +02:00
rtsp.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
rtsp.h http: remove "struct HTTP" 2024-06-12 16:04:53 +02:00
select.c tidy-up: OS names 2024-08-04 19:17:45 +02:00
select.h multi: prepare multi_wait() for future shutdown usage 2024-06-10 13:11:05 +02:00
sendf.c ftp: always offer line end conversions 2024-08-29 20:24:37 +02:00
sendf.h transfer: do not use EXPIRE_NOW while blocked 2024-06-13 15:13:43 +02:00
setopt.c test1521: verify setting options to NULL better 2024-08-23 08:24:34 +02:00
setopt.h setopt: warn on Curl_set*opt() uses not using the return value 2024-05-12 17:27:51 +02:00
setup-os400.h os400: workaround an IBM ASCII run-time library bug 2024-07-27 00:17:13 +02:00
setup-vms.h tidy-up: misc spelling (bit, ASCII) 2024-08-15 15:30:09 +02:00
setup-win32.h tidy-up: OS names 2024-08-04 19:17:45 +02:00
sha256.c lib: prefer CURL_SHA256_DIGEST_LENGTH over the unprefixed name 2024-08-13 10:04:06 +02:00
share.c cpool: rename "connection cache/conncache" to "Connection Pools/cpool" 2024-08-28 13:52:49 +02:00
share.h cpool: rename "connection cache/conncache" to "Connection Pools/cpool" 2024-08-28 13:52:49 +02:00
sigpipe.h transfer: Curl_sendrecv() and event related improvements 2024-08-17 10:52:53 +02:00
slist.c
slist.h
smb.c tidy-up: OS names 2024-08-04 19:17:45 +02:00
smb.h lib: further send/upload handling polish 2024-03-04 08:42:56 +01:00
smtp.c smtp: add tracing feature 2024-08-14 11:51:55 +02:00
smtp.h lib: further send/upload handling polish 2024-03-04 08:42:56 +01:00
sockaddr.h build: prefer USE_IPV6 macro internally (was: ENABLE_IPV6) 2024-04-13 08:33:26 +00:00
socketpair.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
socketpair.h tidy-up: OS names 2024-08-04 19:17:45 +02:00
socks_gssapi.c lib: add eos flag to send methods 2024-08-03 19:53:54 +02:00
socks_sspi.c lib: add eos flag to send methods 2024-08-03 19:53:54 +02:00
socks.c lib: add eos flag to send methods 2024-08-03 19:53:54 +02:00
socks.h
speedcheck.c
speedcheck.h
splay.c splay: use access functions, add asserts, use Curl_timediff 2024-08-16 09:12:13 +02:00
splay.h splay: use access functions, add asserts, use Curl_timediff 2024-08-16 09:12:13 +02:00
strcase.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
strcase.h
strdup.c
strdup.h
strerror.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
strerror.h
strtok.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
strtok.h
strtoofft.c tidy-up: misc spelling (bit, ASCII) 2024-08-15 15:30:09 +02:00
strtoofft.h docs: misc language polish 2024-07-01 16:45:17 +02:00
system_win32.c tidy-up: OS names 2024-08-04 19:17:45 +02:00
system_win32.h system_win32: add missing curl.h include 2024-06-26 10:05:32 +02:00
telnet.c tidy-up: OS names 2024-08-04 19:17:45 +02:00
telnet.h
tftp.c tidy-up: misc spelling (bit, ASCII) 2024-08-15 15:30:09 +02:00
tftp.h
timediff.c
timediff.h docs: misc language polish 2024-07-01 16:45:17 +02:00
timeval.c tidy-up: OS names 2024-08-04 19:17:45 +02:00
timeval.h
transfer.c urldata: remove crlf_conversions counter 2024-08-29 14:30:58 +02:00
transfer.h transfer: Curl_sendrecv() and event related improvements 2024-08-17 10:52:53 +02:00
url.c url: fix connection reuse for HTTP/2 upgrades 2024-09-02 12:39:03 +02:00
url.h cpool: rename "connection cache/conncache" to "Connection Pools/cpool" 2024-08-28 13:52:49 +02:00
urlapi-int.h build: untangle UNITTESTS and DEBUGBUILD macros 2024-05-27 21:15:50 +02:00
urlapi.c urlapi: verify URL *decoded* hostname when set 2024-08-23 13:55:13 +02:00
urldata.h url: fix connection reuse for HTTP/2 upgrades 2024-09-02 12:39:03 +02:00
version_win32.c tidy-up: OS names 2024-08-04 19:17:45 +02:00
version_win32.h tidy-up: OS names 2024-08-04 19:17:45 +02:00
version.c version: fix shadowing a libssh.h symbol 2024-08-20 23:22:26 +02:00
warnless.c
warnless.h warnless: delete orphan declarations 2024-05-14 16:37:11 +02:00
ws.c printf: fix mingw-w64 format checks 2024-09-02 21:03:01 +02:00
ws.h docs: misc language polish 2024-07-01 16:45:17 +02:00