mirror of
https://github.com/curl/curl.git
synced 2026-08-04 13:56:12 +03:00
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
This commit is contained in:
parent
2c2292ecaf
commit
a2bcec0ee0
9 changed files with 499 additions and 22 deletions
|
|
@ -268,6 +268,6 @@ test3024 test3025 test3026 test3027 test3028 test3029 test3030 \
|
|||
\
|
||||
test3100 test3101 test3102 test3103 \
|
||||
test3200 \
|
||||
test3201 test3202 test3203 test3204 test3205
|
||||
test3201 test3202 test3203 test3204 test3205 test3207
|
||||
|
||||
EXTRA_DIST = $(TESTCASES) DISABLED
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue