mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
31c521b047
Sessionid cache management is inseparable from managing individual session lifetimes. E.g. for reference-counted sessions (like those in SChannel and OpenSSL engines) every session addition and removal should be accompanied with refcount increment and decrement respectively. Failing to do so synchronously leads to a race condition that causes symptoms like use-after-free and memory corruption. This commit: - makes existing session cache locking explicit, thus allowing individual engines to manage lock's scope. - fixes OpenSSL and SChannel engines by putting refcount management inside this lock's scope in relevant places. - adds these explicit locking calls to other engines that use sessionid cache to accommodate for this change. Note, however, that it is unknown whether any of these engines could also have this race. Bug: https://github.com/curl/curl/issues/815 Fixes #815 Closes #847 |
||
---|---|---|
.. | ||
axtls.c | ||
axtls.h | ||
cyassl.c | ||
cyassl.h | ||
darwinssl.c | ||
darwinssl.h | ||
gskit.c | ||
gskit.h | ||
gtls.c | ||
gtls.h | ||
mbedtls.c | ||
mbedtls.h | ||
nss.c | ||
nssg.h | ||
openssl.c | ||
openssl.h | ||
polarssl_threadlock.c | ||
polarssl_threadlock.h | ||
polarssl.c | ||
polarssl.h | ||
schannel.c | ||
schannel.h | ||
vtls.c | ||
vtls.h |